f



Detect if running in an emacs shell buffer?

I'm trying write an APL interpreter that runs in an xterm,
or possibly over a dumb-terminal with fewer features.
How can I detect if the "terminal" is emacs?
0
luser
12/22/2016 4:28:57 AM
comp.unix.programmer 10848 articles. 0 followers. kokososo56 (349) is leader. Post Follow

3 Replies
47 Views

Similar Articles

[PageSpeed] 38

On Thursday 22 December 2016 09:58 AM, luser droog wrote:
> I'm trying write an APL interpreter that runs in an xterm,
> or possibly over a dumb-terminal with fewer features.
> How can I detect if the "terminal" is emacs?

Here is what I get in various terminal modes in Emacs 24.5.1:

*term*
$ echo $TERM
eterm-color

*ansi-term*
$ echo $TERM
eterm-color

*eshell*
$ echo $TERM
dumb

*shell*
$ echo $TERM
dumb

-- 
Udyant Wig
.... the sentiments of men are known, not only by what they receive, but what
they reject also ...
                                -- Thomas Jefferson
0
Udyant
12/22/2016 9:54:06 AM
luser droog <mijoryx@yahoo.com> writes:
> I'm trying write an APL interpreter that runs in an xterm,
> or possibly over a dumb-terminal with fewer features.
> How can I detect if the "terminal" is emacs?

If you really want to detect emacs and not just the capabilities of the
terminal emulator,

	   Emacs sets the environment variable `INSIDE_EMACS' in the
	subshell to a comma-separated list including the Emacs version.
	Programs can check this variable to determine whether they are
	running inside an Emacs subshell.

	   Emacs also sets the `EMACS' environment variable (to `t') if
	it is not already defined.  *Warning:* This environment variable
	is deprecated.  Programs that check this variable should be
	changed to check `INSIDE_EMACS' instead.
0
Rainer
12/22/2016 2:58:50 PM
On 2016-12-21 20:28, luser droog wrote:

> I'm trying write an APL interpreter that runs in an xterm,
> or possibly over a dumb-terminal with fewer features.
> How can I detect if the "terminal" is emacs?

Inspect TERM environment variable.

-- 
Please *no* private Cc: on mailing lists and newsgroups
Personal signed mail: please _encrypt_ and sign
Don't clear-text sign: http://cr.yp.to/smtp/8bitmime.html

0
Ian
12/22/2016 7:51:34 PM
Reply: