From: Noam Postavsky <npostavs@gmail.com>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: 21041@debbugs.gnu.org
Subject: bug#21041: 24.3; emacsclient doesn't discover ansi-term correctly
Date: Mon, 23 Jul 2018 21:20:09 -0400 [thread overview]
Message-ID: <87r2jt4egm.fsf@gmail.com> (raw)
In-Reply-To: <wvr4lhel8lzh.fsf@phst2.muc.corp.google.com> (Philipp Stephani's message of "Sun, 12 Jul 2015 16:54:42 +0200")
[-- Attachment #1: Type: text/plain, Size: 683 bytes --]
merge 21041 22639
tags 21041 + patch
quit
Philipp Stephani <p.stephani2@gmail.com> writes:
> M-x ansi-term RET RET
> emacsclient -t
>
> Expected: emacsclient shows an error message
> Actual: Emacs frame opened inside ansi-term
And then gets stuck, as described in Bug#22639.
> term.el sets TERM to eterm-color, but emacsclient.c checks only for
> eterm (exact match). I'd suggest to introduce more defensive checks in
> emacsclient.c: abort whenever either TERM starts with eterm (prefix
> match) or INSIDE_EMACS is set.
I think "or" is too aggressive, "and" makes more sense. "eterm" is
somewhat generic, there used to be a non-Emacs related terminal emulator
called that.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 955 bytes --]
From d9d779ebe7d62e9ea928ead61a7c345f8eb2058a Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
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 b139b2fe3f..b0243f99c2 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.11.0
next prev parent reply other threads:[~2018-07-24 1:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-12 14:54 bug#21041: 24.3; emacsclient doesn't discover ansi-term correctly Philipp Stephani
2018-07-24 1:20 ` Noam Postavsky [this message]
2018-08-08 23:51 ` Noam Postavsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r2jt4egm.fsf@gmail.com \
--to=npostavs@gmail.com \
--cc=21041@debbugs.gnu.org \
--cc=p.stephani2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).