bug-gnu-emacs
[Top][All Lists]
Advanced

[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


From: Michael Hoffman
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

On Mon, Jan 23, 2017 at 1:18 PM, Eli Zaretskii eliz-at-gnu.org |gmane3-hoffman| <address@hidden> wrote:
> From: "Michael Hoffman" <address@hidden>
> 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/59be5828de98814b8aa32718bf2b6196db085db1
>
> 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.

address@hidden ~/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  <address@hidden>

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]