all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Michael Hoffman" <gmane3-hoffman@snkmail.com>
To: 11919@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	[thread overview]
Message-ID: <26119-1485194282-859484@sneakemail.com> (raw)
In-Reply-To: <CADgGpBjp__m3Tn3KgiBNpDgbz9ce2V46iinXeNTUXwDhANQ2kw@mail.gmail.com>

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





  reply	other threads:[~2017-01-23 17:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12  0:45 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
2017-01-23 17:54 ` Michael Hoffman [this message]
2017-01-23 18:18   ` Eli Zaretskii
2017-01-23 18:30     ` Eli Zaretskii
2017-01-23 19:24     ` Michael Hoffman
2017-01-27  9:30       ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26119-1485194282-859484@sneakemail.com \
    --to=gmane3-hoffman@snkmail.com \
    --cc=11919@debbugs.gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.