[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [screen-devel] [PATCH] ansi: add support for xterm OSC 11
From: |
Lubomir Rintel |
Subject: |
Re: [screen-devel] [PATCH] ansi: add support for xterm OSC 11 |
Date: |
Thu, 31 Aug 2017 16:24:50 +0200 |
On Thu, 2017-08-31 at 11:32 +0200, Amadeusz Sławiński wrote:
> Hey,
>
> On Wed, 30 Aug 2017 17:23:41 +0200
> Lubomir Rintel <address@hidden> wrote:
>
> > It allows for getting and setting the background color. Notably, Vim uses
> > OSC 11 to learn whether it's running on a light or dark colored terminal
> > and choose a color scheme accordingly.
> >
> > - if (typ == 0 || typ == 1 || typ == 2 || typ == 20 || typ == 39
> > || typ == 49) {
> > + if (typ == 0 || typ == 1 || typ == 2 || typ == 20 || typ == 39
> > || typ == 49 || typ == 11) {
>
> Values here are in growing order, so put typ == 11 between 2 and 20 checks,
> for clarity.
> > + if (i == 1)
> > + AddStr("\033\\");
> > + else
> > + AddChar(7);
>
> From what I can see string terminator can either be "\e\\" or '\a'
> (http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands),
> so it would be nice if we could handle both correctly, without forcing
> one depending on i parameter.
>
> In xterm I see:
> $ echo -ne "\e]11;?\e\\"
> ^[]11;rgb:0000/0000/0505^[\
> $ echo -ne "\e]11;?\a"
> ^[]11;rgb:0000/0000/0505^G
>
> > }
> >
> > void ClearAllXtermOSC()
>
> Do notice that you change SetXtermOSC, and there are 2 places in code,
> where code loops over all values, so you need to also update those.
Thank you for the response.
I'll soon follow-up with a patch that addresses all of the points. In
fact, two patches: The OSC terminator issue is in fact not related to
this particular sequence, so I'll split it out.
As a matter of fact, Vim (which is why I care about this) emits the
sequence terminated with a BEL and doesn't care about how the response
is terminated, so I don't really mind if that patch won't get applied.
Lubo