aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell
diff options
context:
space:
mode:
authorMiha Rihtaršič2021-10-25 15:24:29 +0200
committerLars Ingebrigtsen2021-10-25 15:24:35 +0200
commit85ea3f7f47ef1a767aa2954be896d4aaef3163c6 (patch)
tree74b7d2e387b94fe3d4b96defd65e69ab8ffa210a /lisp/eshell
parent50f9436146ae1814d4f4c6670bccac7c76db292f (diff)
downloademacs-85ea3f7f47ef1a767aa2954be896d4aaef3163c6.tar.gz
emacs-85ea3f7f47ef1a767aa2954be896d4aaef3163c6.zip
Fix issue with interpreting ANSI codes in eshell
* lisp/eshell/esh-mode.el (eshell-mode): Make window point advance on insertion. (eshell-output-filter): Don't use insert-before-markers (bug#45380).
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/esh-mode.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 98e89037f33..8e6506c301c 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -315,6 +315,8 @@ and the hook `eshell-exit-hook'."
315 (setq-local bookmark-make-record-function #'eshell-bookmark-make-record) 315 (setq-local bookmark-make-record-function #'eshell-bookmark-make-record)
316 (setq local-abbrev-table eshell-mode-abbrev-table) 316 (setq local-abbrev-table eshell-mode-abbrev-table)
317 317
318 (setq-local window-point-insertion-type t)
319
318 (setq-local list-buffers-directory (expand-file-name default-directory)) 320 (setq-local list-buffers-directory (expand-file-name default-directory))
319 321
320 ;; always set the tab width to 8 in Eshell buffers, since external 322 ;; always set the tab width to 8 in Eshell buffers, since external
@@ -696,13 +698,10 @@ This is done after all necessary filtering has been done."
696 (setq oend (+ oend nchars))) 698 (setq oend (+ oend nchars)))
697 ;; Let the ansi-color overlay hooks run. 699 ;; Let the ansi-color overlay hooks run.
698 (let ((inhibit-modification-hooks nil)) 700 (let ((inhibit-modification-hooks nil))
699 (insert-before-markers string)) 701 (insert string))
700 (if (= (window-start) (point)) 702 (if (= (window-start) (point))
701 (set-window-start (selected-window) 703 (set-window-start (selected-window)
702 (- (point) nchars))) 704 (- (point) nchars)))
703 (if (= (point) eshell-last-input-end)
704 (set-marker eshell-last-input-end
705 (- eshell-last-input-end nchars)))
706 (set-marker eshell-last-output-start ostart) 705 (set-marker eshell-last-output-start ostart)
707 (set-marker eshell-last-output-end (point)) 706 (set-marker eshell-last-output-end (point))
708 (force-mode-line-update)) 707 (force-mode-line-update))