Changing Cursor shape / colour by escape sequence

359 views
Skip to first unread message

Chris Sutcliffe

unread,
Apr 2, 2009, 12:00:19 PM4/2/09
to mintty-...@googlegroups.com
Is it possible to change the cursor shape / colour via escape
sequences in MinTTY? Doing some Googling I came across:

echo -ne "\e]?81;0;112c"

Which I understand should set the cursor to a non-blinking block
cursor in an xterm. Unfortunately it doesn't seem to work in MinTTY.

Cheers!

Chris

--
Chris Sutcliffe
http://emergedesktop.org

Andy Koppe

unread,
Apr 2, 2009, 5:28:52 PM4/2/09
to mintty-...@googlegroups.com
> Is it possible to change the cursor shape / colour via escape
> sequences in MinTTY?  Doing some Googling I came across:
>
> echo -ne "\e]?81;0;112c"
>
> Which I understand should set the cursor to a non-blinking block
> cursor in an xterm.  Unfortunately it doesn't seem to work in MinTTY.

Could you point me at a spec for that? I couldn't find it at
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html.

Andy

Thomas Dickey

unread,
Apr 2, 2009, 7:41:18 PM4/2/09
to MinTTY Discussion
It's for the Linux console (probably not implemented in any X
terminals, though some accrete via cut/paste).

For example: http://linuxgazette.net/137/anonymous.html

--
Thomas E. Dickey <dic...@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net

Chris Sutcliffe

unread,
Apr 2, 2009, 9:22:09 PM4/2/09
to mintty-...@googlegroups.com
Hey Andy,

> Could you point me at a spec for that? I couldn't find it at
> http://invisible-island.net/xterm/ctlseqs/ctlseqs.html.

If I read this properly:

P s = 1 2 → Change text cursor color to P t

Shouldn't:

echo -ne "\e]12;12\a"

Set the text cursor color to blue?

Chris Sutcliffe

unread,
Apr 2, 2009, 10:00:17 PM4/2/09
to mintty-...@googlegroups.com
>> Could you point me at a spec for that? I couldn't find it at
>> http://invisible-island.net/xterm/ctlseqs/ctlseqs.html.
>
> If I read this properly:
>
> P s = 1 2 → Change text cursor color to P t
>
> Shouldn't:
>
> echo -ne "\e]12;12\a"
>
> Set the text cursor color to blue?

Doing a little more Googling, I found the correct format:

echo -ne "\e]12;<Color Name>\a"

for example:

echo -ne "\e]12;RoyalBlue1\a"

Should set the cursor to RoyalBlue1.

Cheers!

Andy Koppe

unread,
Apr 3, 2009, 1:56:49 AM4/3/09
to MinTTY Discussion
On Apr 3, 12:41 am, Thomas Dickey <dic...@his.com> wrote:
> On Apr 2, 5:28 pm, Andy Koppe <andy.ko...@gmail.com> wrote:
>
> > > Is it possible to change the cursor shape / colour via escape
> > > sequences in MinTTY?  Doing some Googling I came across:
>
> > > echo -ne "\e]?81;0;112c"
>
> > > Which I understand should set the cursor to a non-blinking block
> > > cursor in an xterm.  Unfortunately it doesn't seem to work in MinTTY.
>
> > Could you point me at a spec for that? I couldn't find it at
> >http://invisible-island.net/xterm/ctlseqs/ctlseqs.html.
>
> It's for the Linux console (probably not implemented in any X
> terminals, though some accrete via cut/paste).
>
> For example:http://linuxgazette.net/137/anonymous.html

Thanks Thomas, and welcome to the group!

I think I'll give that one a miss then, as it doesn't even appear in
'man console_codes', and of course the cursor shape can be chosen in
the options dialog already.

Andy

Andy Koppe

unread,
Apr 3, 2009, 2:03:25 AM4/3/09
to MinTTY Discussion
On Apr 3, 3:00 am, Chris Sutcliffe <ir0nh...@gmail.com> wrote:
> >> Could you point me at a spec for that? I couldn't find it at
> >>http://invisible-island.net/xterm/ctlseqs/ctlseqs.html.
>
> > If I read this properly:
>
> > P s = 1 2 → Change text cursor color to P t
>
> > Shouldn't:
>
> > echo -ne "\e]12;12\a"
>
> > Set the text cursor color to blue?
>
> Doing a little more Googling, I found the correct format:
>
> echo -ne "\e]12;<Color Name>\a"
>
> for example:
>
> echo -ne "\e]12;RoyalBlue1\a"
>
> Should set the cursor to RoyalBlue1.

You're right, those xterm sequences are not currently supported. I
entered issue 78 for this. I'll probably only implement support for
#rrggbb hexadecimal colours though.

(Mental note: must do a full review of the xterm spec.)

Andy
Reply all
Reply to author
Forward
0 new messages