]> git.eshelyaron.com Git - emacs.git/commitdiff
Make erase-in-line conform to ANSI spec in term
authorDaniel Colascione <dancol@dancol.org>
Fri, 7 Mar 2025 19:07:12 +0000 (11:07 -0800)
committerEshel Yaron <me@eshelyaron.com>
Sun, 9 Mar 2025 10:24:21 +0000 (11:24 +0100)
When handling \e[<N>K escape sequences, we're supposed to erase both to
the left _and_ to the right of the cursor when N is two.

* lisp/term.el (term-erase-in-line): make condition check more correct

(cherry picked from commit 4ea07cc4b4a676a5f8094d565cd3cea89e6ec77d)

lisp/term.el

index a7bb7057dc14c1ef2af2459c91502b31af856d20..0048e0c690856dd63e3e4fd6a62e0e5516f3ae7b 100644 (file)
@@ -4009,7 +4009,7 @@ The top-most line is line 0."
                            '(term-line-wrap t rear-nonsticky t)))))
 
 (defun term-erase-in-line (kind)
-  (when (= kind 1) ;; erase left of point
+  (when (>= kind 1) ;; erase left of point
     (let ((cols (term-horizontal-column)) (saved-point (point)))
       (term-vertical-motion 0)
       (delete-region (point) saved-point)