From 5afbf62674e741b06c01216fe37a5439e9d42307 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Mon, 23 Jul 2018 21:01:01 -0400 Subject: [PATCH] Fix emacsclient check for term.el buffer (Bug#21041) * lib-src/emacsclient.c (find_tty): Check for any TERM value with prefix of "eterm", not just "eterm" itself. Also check for ",term:" in INSIDE_EMACS value. --- lib-src/emacsclient.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index b139b2fe3f6..b0243f99c26 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1114,7 +1114,9 @@ find_tty (const char **tty_type, const char **tty_name, int noabort) } } - if (strcmp (type, "eterm") == 0) + const char *inside_emacs = egetenv ("INSIDE_EMACS"); + if (inside_emacs && strstr (inside_emacs, ",term:") + && strprefix ("eterm", type)) { if (noabort) return 0; -- 2.39.5