summaryrefslogtreecommitdiff
path: root/lisp/eshell/esh-mode.el
diff options
context:
space:
mode:
authorMiha Rihtaršič <miha@kamnitnik.top>2021-10-25 15:24:29 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-10-25 15:24:35 +0200
commit85ea3f7f47ef1a767aa2954be896d4aaef3163c6 (patch)
tree74b7d2e387b94fe3d4b96defd65e69ab8ffa210a /lisp/eshell/esh-mode.el
parent50f9436146ae1814d4f4c6670bccac7c76db292f (diff)
downloademacs-85ea3f7f47ef1a767aa2954be896d4aaef3163c6.tar.gz
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/esh-mode.el')
-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'."
(setq-local bookmark-make-record-function #'eshell-bookmark-make-record)
(setq local-abbrev-table eshell-mode-abbrev-table)
+ (setq-local window-point-insertion-type t)
+
(setq-local list-buffers-directory (expand-file-name default-directory))
;; 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."
(setq oend (+ oend nchars)))
;; Let the ansi-color overlay hooks run.
(let ((inhibit-modification-hooks nil))
- (insert-before-markers string))
+ (insert string))
(if (= (window-start) (point))
(set-window-start (selected-window)
(- (point) nchars)))
- (if (= (point) eshell-last-input-end)
- (set-marker eshell-last-input-end
- (- eshell-last-input-end nchars)))
(set-marker eshell-last-output-start ostart)
(set-marker eshell-last-output-end (point))
(force-mode-line-update))