GNU bug report logs - #11919
24.1; term-emulate-term does not process bash's Ctrl-Z signal of directory name when an AnSi message is present

Previous Next

Package: emacs;

Reported by: Michael Hoffman <b3i4old02 <at> sneakemail.com>

Date: Thu, 12 Jul 2012 00:52:01 UTC

Severity: normal

Found in version 24.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Michael Hoffman" <gmane3-hoffman <at> snkmail.com>
To: 11919 <at> debbugs.gnu.org
Subject: bug#11919: 24.1; term-emulate-term does not process bash's Ctrl-Z signal of directory name when an AnSi message is present
Date: Mon, 23 Jan 2017 12:54:10 -0500
On 07/11/2012 08:45 PM, Michael Hoffman wrote:

> 1) emacs -Q
> 2) M-x ansi-term RET /bin/bash RET
> 3) PS1='\033AnSiTu x\012$ ' RET
>
>  From then on, every prompt will be preceded by a Ctrl-Z character and
> the working directory. This is because recent versions of bash
> try to figure out whether they are running under emacs, and if they
> are, output Ctrl-Z and the working directory before the PS1 prompt.
> term-emulate-terminal normally eliminates such garbage, but not when
> it has also processed an AnSi message. The elimination only happens
> when the following conditions are true:
>
> (and (eq char ?\032)
>       (not handled-ansi-message))
>
> Suggested fix: eliminate the "(not handled-ansi-message)" form.

I have located the original commit that added the `handled-ansi-message` 
behavior: 
https://github.com/emacs-mirror/emacs/commit/59be5828de98814b8aa32718bf2b6196db085db1

Eli Zaretskii added it to "Let term-handle-ansi-terminal-messages 
override what Bash says about its current directory."

In order to keep this behavior but not print garbage to the buffer: I 
would suggest that perhaps the call to `term-command-hook` is what 
should be conditioned on `(not handled-ansi-message)` and not the rest 
of the code in this branch which seems to remove the garbage.

Michael Hoffman




This bug report was last modified 8 years and 113 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.