]> git.eshelyaron.com Git - emacs.git/commit
Handle OSC sequences in term (bug#78263)
authorStephane Zermatten <szermatt@gmx.net>
Wed, 4 Jun 2025 18:00:42 +0000 (21:00 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 18 Jun 2025 08:11:49 +0000 (10:11 +0200)
commit69b4ae451bfde502c1a1bb166747a837db522467
treea6336af8df8afa6cf9217719ba613d3563e69f3e
parentd61225f2367ceb1585e6f0038b7b1a81e5e9204f
Handle OSC sequences in term (bug#78263)

Handlers can be registered to term-osc-handler, which by defaults,
supports OSC 0, 2, 7 and 8, using handlers defined in ansi-osc.
Unknown OSC sequences are ignored.

* lisp/term.el (term-emulate-terminal): Handle OSC sequences.
(term-osc-handler): New configuration variable.
(term-control-seq-regexp): Extended regexp.
(term--osc-max-bytes): New private constant.
* lisp/ansi-osc.el (ansi-osc-handler): Handle OSC 0 like OSC 2.
* test/lisp/term-tests.el (term-ignore-osc, term-handle-osc)
(term-call-ansi-osc-handlers): New tests.

(cherry picked from commit 6c13da2caf629b14853e9aa57e59aeeeec14e68f)
lisp/ansi-osc.el
lisp/term.el
test/lisp/term-tests.el