GNU bug report logs - #78263
[PATCH 1/3] Ignore OSC sequences in term instead of printing them

Previous Next

Package: emacs;

Reported by: Stephane Zermatten <szermatt <at> gmail.com>

Date: Mon, 5 May 2025 15:21:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Full log


View this message in rfc822 format

From: Stéphane Zermatten <szermatt <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Per Bothner <per <at> bothner.com>, Jared Finder <jared <at> finder.org>, 78263 <at> debbugs.gnu.org
Subject: bug#78263: [PATCH 1/3] Ignore OSC sequences in term instead of printing them
Date: Wed, 4 Jun 2025 21:04:58 +0300
[0001-Handle-OSC-sequences-in-term-bug-78263.patch (application/octet-stream, attachment)]
[Message part 2 (text/plain, inline)]

> On 3 Jun 2025, at 14:09, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Stéphane Zermatten <szermatt <at> gmail.com>
>> Date: Mon, 2 Jun 2025 20:01:32 +0300
>> Cc: Eli Zaretskii <eliz <at> gnu.org>,
>> Per Bothner <per <at> bothner.com>,
>> 78263 <at> debbugs.gnu.org
>> 
>> I updated the change, see the new version attached.
> 
> I have a few minor comments below.
> 
>> No news from the copyright assignment front yet.
> 
> It will take around two weeks.
> 
>> 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 properly ignored.
>> 
>> * lisp/term.el:
>>  (term-emulate-terminal): handle OSC sequences
>>  term-osc-handler: new custom option
>>  term-control-seq-regexp: extended regexp
>>  term--osc-max-byte: new private constant
>> * lisp/ansi-osc.el:
>>  ansi-osc-handler: handle OSC 0 (like OSC 2)
> 
> Please reformat the log message according to our conventions: function
> and variable names in parentheses, 2 spaces between sentences, etc.
> For the details see CONTRIBUTE and also consult the many examples of
> log messages in Git.

Done (Correctly, this time, hopefully)

> 
>> +(defcustom term-osc-handlers nil
>> +  "Terminal-specific OSC sequence handler function alist.
>> +
>> +OSC (Operating System Command) is a category of ANSI escape sequence
>> +used in terminal application to introduce custom commands. Terminals
>> +ignore unknown OSC sequences by default. Handlers can be registered here
>> +to add support for new OSC sequences to `term'.
> 
> Two spaces between sentences, here and elsewhere.

Done 

> 
>> +Functions in this alist are passed matching valid OSC sequences as
>> +they're sent to the terminal.
>> +
>> +Valid OSC sequences are of the form
>> +  ESC ] code ; text BEL
>> +  ESC ] code ; text ESC \
>> +
>> +Each entry has the form (CODE . FUNCTION), where CODE is the string that
>> +appears before the semicolon.
>> +
>> +FUNCTION is called with two arguments CODE and TEXT with the term buffer
>> +active and its point and state active at the time the OSC sequence
>> +appeared in the stream.
> 
> This should clarify what is TEXT in this context.

A rephrased it a bit. Hopefully it is clearer.

> 
> Thanks.


This bug report was last modified 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.