all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Hoffman <hoffman@cantab.net>
To: "Eli Zaretskii eliz-at-gnu.org |gmane3-hoffman|"
	<0wdp3p2xrt@sneakemail.com>
Cc: 11919@debbugs.gnu.org, Michael Hoffman <gmane3-hoffman@snkmail.com>
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 14:24:28 -0500	[thread overview]
Message-ID: <CADgGpBiN8vrHKZNj8vdcJWLqWm9-npAPdkG93zgFHYKQxi9OTg@mail.gmail.com> (raw)
In-Reply-To: <83ziih3aic.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 3050 bytes --]

On Mon, Jan 23, 2017 at 1:18 PM, Eli Zaretskii eliz-at-gnu.org
|gmane3-hoffman| <0wdp3p2xrt@sneakemail.com> wrote:

> > From: "Michael Hoffman" <gmane3-hoffman@snkmail.com>
> > Date: Mon, 23 Jan 2017 12:54:10 -0500
> >
> > I have located the original commit that added the `handled-ansi-message`
> > behavior:
> > https://github.com/emacs-mirror/emacs/commit/59be5828de98814
> b8aa32718bf2b6196db085db1
> >
> > Eli Zaretskii added it to "Let term-handle-ansi-terminal-messages
> > override what Bash says about its current directory."
>
> I was just committing someone else's patch in that case.
>

Please accept my apologies.


> See these messages in the archives for the reason why that change was
> done:
>
>   https://lists.gnu.org/archive/html/emacs-pretest-bug/2005-11
> /msg00020.html
>   https://lists.gnu.org/archive/html/emacs-pretest-bug/2005-11
> /msg00103.html
>   https://lists.gnu.org/archive/html/emacs-pretest-bug/2005-12
> /msg00089.html
>
> If you can propose changes that solve this issue without
> re-introducing that one, please do.
>

The below patch eliminates the garbage printing while maintaining the
behavior added in 2005 of having `handled-ansi-message` preventing any
updates to `default-directory` based on a \032 escape.

mhoffman@mhoffman2 ~/share/emacs/25.1/lisp
$ diff -u <(zcat term.el.gz) term.el
--- /dev/fd/63  2017-01-23 14:13:55.948963291 -0500
+++ term.el     2017-01-23 14:11:43.903830242 -0500
@@ -2869,15 +2869,16 @@
                         ((eq char ?\017))     ; Shift In - ignored
                         ((eq char ?\^G) ;; (terminfo: bel)
                          (beep t))
-                        ((and (eq char ?\032)
-                               (not handled-ansi-message))
+                        ((eq char ?\032)
                          (let ((end (string-match "\r?$" str i)))
                            (if end
-                               (funcall term-command-hook
-                                        (decode-coding-string
-                                         (prog1 (substring str (1+ i) end)
-                                           (setq i (match-end 0)))
-                                         locale-coding-system))
+                                (progn
+                                  (unless handled-ansi-message
+                                    (funcall term-command-hook
+                                             (decode-coding-string
+                                              (substring str (1+ i) end)
+                                              locale-coding-system)))
+                                  (setq i (match-end 0)))
                              (setq term-terminal-parameter (substring str
i))
                              (setq term-terminal-state 4)
                              (setq i str-length))))

====
ChangeLog:

2017-01-23  Michael Hoffman  <emacs-hoffman@sneakemail.com>

  * term.el (term-emulate-terminal): fix bug#11919:
  do not display ?\032 escape codes even when `handled-ansi-message` is true

[-- Attachment #2: Type: text/html, Size: 5384 bytes --]

  parent reply	other threads:[~2017-01-23 19:24 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
2017-01-23 18:18   ` Eli Zaretskii
2017-01-23 18:30     ` Eli Zaretskii
2017-01-23 19:24     ` Michael Hoffman [this message]
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=CADgGpBiN8vrHKZNj8vdcJWLqWm9-npAPdkG93zgFHYKQxi9OTg@mail.gmail.com \
    --to=hoffman@cantab.net \
    --cc=0wdp3p2xrt@sneakemail.com \
    --cc=11919@debbugs.gnu.org \
    --cc=gmane3-hoffman@snkmail.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 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.