[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/coterm 73aa1f3 31/80: Properly handle OSC and Emacs spe
From: |
ELPA Syncer |
Subject: |
[elpa] externals/coterm 73aa1f3 31/80: Properly handle OSC and Emacs specific escape sequences |
Date: |
Wed, 13 Oct 2021 18:57:30 -0400 (EDT) |
branch: externals/coterm
commit 73aa1f37a821e67ddb666fde073e103f188170cf
Author: m <>
Commit: m <>
Properly handle OSC and Emacs specific escape sequences
---
coterm.el | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/coterm.el b/coterm.el
index b600d83..11f75a8 100644
--- a/coterm.el
+++ b/coterm.el
@@ -2,7 +2,9 @@
;;; Terminal emulation
-;; Differences from `term-control-seq-regexp': Removed \t, \032 (\C-z), \eAnSiT
+;; Differences from `term-control-seq-regexp':
+;; Removed: \t, \032 (\C-z)
+;; Added: OSC sequence \e] ... ; ... \e\\ (or \a)
(defconst coterm--t-control-seq-regexp
(concat
;; A control character,
@@ -10,6 +12,12 @@
;; a C1 escape coded character (see [ECMA-48] section 5.3 "Elements
;; of the C1 set"),
"\e\\(?:[DM78c]\\|"
+ ;; Emacs specific control sequences from term.el. In coterm, we simply
+ ;; ignore them.
+ "AnSiT[^\n]+\n\\|"
+ ;; OSC seqence. We print them normally to let
+ ;; `comint-output-filter-functions' handle them
+ "][0-9A-Za-z]*;.*?\\(?:\a\\|\e\\\\\\)\\|"
;; or an escape sequence (section 5.4 "Control Sequences"),
"\\[\\([\x30-\x3F]*\\)[\x20-\x2F]*[\x40-\x7E]\\)\\)")
"Regexp matching control sequences handled by term.el.")
@@ -383,6 +391,8 @@ initialize it sensibly."
(setq coterm--t-scroll-beg 0)
(setq coterm--t-scroll-end coterm--t-height)
(setq coterm--t-insert-mode nil))
+ (?\] (pass-through)) ;; OSC sequence, handled by comint
+ (?A (ins)) ;; Ignore term.el specific \eAnSiT sequences
(?\[
(pcase (aref string (1- ctl-end))
(?m ; Let `comint-output-filter-functions' handle this
@@ -502,12 +512,8 @@ initialize it sensibly."
(cond
((setq match (string-match coterm--t-control-seq-prefix-regexp
string ctl-end))
- (while (setq match (string-match
coterm--t-control-seq-prefix-regexp
- string (1+ match)))
- (setq ctl-end match))
- (setq match ctl-end)
(ins)
- (setq coterm--t-unhandled-fragment (substring string
last-match-end)))
+ (setq coterm--t-unhandled-fragment (substring string match)))
((null last-match-end)
;; Optimization, no substring means no string copying
(coterm--t-insert proc-filt process string will-insert-newlines))
- [elpa] externals/coterm dc5f8db 38/80: Improve doc string, add autoload cookie, (continued)
- [elpa] externals/coterm dc5f8db 38/80: Improve doc string, add autoload cookie, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm ee37b4b 39/80: Initial support for char-mode and scroll snapping, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 6f42ba6 45/80: Initialize home marker properly, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 5e40af4 47/80: Prevent modification of user input harder, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm dc9466e 57/80: Implement \t (move cursor to tab stop), needed for "emacs -nw", ELPA Syncer, 2021/10/13
- [elpa] externals/coterm db17a99 62/80: Describe terminal emulation, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm c52f413 67/80: Keep char mode in less after pressing a digit, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm c717c84 75/80: Bind inhibit-read-only to t for terminal emulation, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 570ae6d 74/80: Mention auto char mode as a difference from term.el, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm c825746 27/80: Fix issue with ansi-color context marker, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 73aa1f3 31/80: Properly handle OSC and Emacs specific escape sequences,
ELPA Syncer <=
- [elpa] externals/coterm f4f69ab 32/80: Export TERMINFO environment variable, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 654e286 49/80: Fix mistake in turning mode off, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm fd4041e 58/80: Remove redundant "(dirty)", ELPA Syncer, 2021/10/13
- [elpa] externals/coterm edfdbb7 50/80: Ignore sequences \e= end \e> (output by mpv), ELPA Syncer, 2021/10/13
- [elpa] externals/coterm e534194 60/80: Fix buffer-locality of saved scroll-margin, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 952b917 52/80: Better indication of current char-mode status, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm bfcd5e4 63/80: Properly indicate that pmark is synchronized, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 96a636e 64/80: Protect user input at EOB more accurately, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm bd7c681 73/80: Further document the "less" line-wrap workaround, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm e0a38cc 53/80: Add more documentation for auto char mode, ELPA Syncer, 2021/10/13