branch: externals/coterm commit 710e7d3087cc21cebeacf7168b6043d4930cf019 Author: Miha Rihtaršič <m...@kamnitnik.top> Commit: Miha Rihtaršič <m...@kamnitnik.top>
Fix cursor restoration escape code --- coterm.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/coterm.el b/coterm.el index 5806f3c616..ad06ce5c69 100644 --- a/coterm.el +++ b/coterm.el @@ -1025,9 +1025,10 @@ buffer and the scrolling region must cover the whole screen." ansi-color-context))) (?8 (ins) ;; Restore cursor (terminfo: rc) (when-let ((cursor coterm--t-saved-cursor)) - (setq coterm--t-row (max (car cursor) (1- coterm--t-height))) + (setq coterm--t-saved-cursor nil) + (setq coterm--t-row (min (car cursor) (1- coterm--t-height))) (setq cursor (cdr cursor)) - (setq coterm--t-col (max (car cursor) (1- coterm--t-width))) + (setq coterm--t-col (min (car cursor) (1- coterm--t-width))) (setq cursor (cdr cursor)) (setq ansi-color-context-region (car cursor)) (setq ansi-color-context (cadr cursor))