zcaudate
zcaudate

Reputation: 14258

how to detect if emacs is running in a terminal or a window?

I'm hoping to be able to branch on a flag in emacs to detect whether it is running in a terminal or a windowed app (i.e. the OS X Emacs app)

Is there such a flag?

Upvotes: 0

Views: 189

Answers (1)

choroba
choroba

Reputation: 241908

Check the value of the window-system variable. In a terminal, it should be nil.

For boolean tests, use the display-graphic-p function.

Upvotes: 3

Related Questions