diff options
| author | Johan Claesson | 2016-12-28 12:56:11 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2017-01-04 23:20:47 -0500 |
| commit | d88cdad2847726438c7d1de9fd2651c4be9243aa (patch) | |
| tree | 536d471f117c2c2d14b13d2ab59285f41000ef5f | |
| parent | 0392f942c787f1a42b3e5d9516a447687ed3baef (diff) | |
| download | emacs-d88cdad2847726438c7d1de9fd2651c4be9243aa.tar.gz emacs-d88cdad2847726438c7d1de9fd2651c4be9243aa.zip | |
Fix term.el handling of ^Z-sequences spanning chunks
Bash will after each command send ?\032 and the current directory "/tmp"
to inform term.el. Bash output is buffered in 4096 bytes chunks. If a
command outputs roughly 4096 bytes then the end of the first chunk will
be "/tm" (Bug#13350).
* lisp/term.el (term-emulate-terminal): Change the regexp to find the
end of the ?\032 sequence to use \n instead of $, the latter can match
end of string as well.
Copyright-paperwork-exempt: yes
| -rw-r--r-- | lisp/term.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/term.el b/lisp/term.el index a3933ae4a4f..5259571eb6d 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -2903,12 +2903,12 @@ See `term-prompt-regexp'." | |||
| 2903 | (beep t)) | 2903 | (beep t)) |
| 2904 | ((and (eq char ?\032) | 2904 | ((and (eq char ?\032) |
| 2905 | (not handled-ansi-message)) | 2905 | (not handled-ansi-message)) |
| 2906 | (let ((end (string-match "\r?$" str i))) | 2906 | (let ((end (string-match "\r?\n" str i))) |
| 2907 | (if end | 2907 | (if end |
| 2908 | (funcall term-command-hook | 2908 | (funcall term-command-hook |
| 2909 | (decode-coding-string | 2909 | (decode-coding-string |
| 2910 | (prog1 (substring str (1+ i) end) | 2910 | (prog1 (substring str (1+ i) end) |
| 2911 | (setq i (match-end 0))) | 2911 | (setq i (1- (match-end 0)))) |
| 2912 | locale-coding-system)) | 2912 | locale-coding-system)) |
| 2913 | (setq term-terminal-parameter (substring str i)) | 2913 | (setq term-terminal-parameter (substring str i)) |
| 2914 | (setq term-terminal-state 4) | 2914 | (setq term-terminal-state 4) |