[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#11919: 24.1; term-emulate-term does not process bash's Ctrl-Z signal
bug#11919: 24.1; term-emulate-term does not process bash's Ctrl-Z signal of directory name when an AnSi message is present
Mon, 23 Jan 2017 12:54:10 -0500
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0
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)
Suggested fix: eliminate the "(not handled-ansi-message)" form.
I have located the original commit that added the `handled-ansi-message`
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.
- bug#11919: 24.1; term-emulate-term does not process bash's Ctrl-Z signal of directory name when an AnSi message is present,
Michael Hoffman <=