You are not logged in.

#1 2023-05-21 19:08:28

HydroDiOxide
Member
Registered: 2007-10-06
Posts: 103

[SOLVED] Change terminal cursor colour

I'm using GNOME Terminal with zsh/oh my zsh.

I can change my cursor colour to red with: echo -ne "\033]12;Red\007". (I have no idea what that code actually means.)

Can I change the cursor to an RGB colour or, at least, one of the colours I seen when running spectrum_ls?

Last edited by HydroDiOxide (2023-05-22 07:02:57)


"Overspecialize and you breed in weakness..." Major Motoko Kusanagi

Offline

#2 2023-05-21 19:21:01

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,734

Re: [SOLVED] Change terminal cursor colour

You can use #rrggbb colors:

printf '\e]12;#1793d0\007'

Offline

#3 2023-05-21 19:36:00

HydroDiOxide
Member
Registered: 2007-10-06
Posts: 103

Re: [SOLVED] Change terminal cursor colour

seth wrote:

You can use #rrggbb colors:

printf '\e]12;#1793d0\007'

Thanks for that. Would you mind breaking that command down, so I understand what the different segments do?


"Overspecialize and you breed in weakness..." Major Motoko Kusanagi

Offline

#4 2023-05-21 19:42:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,734

Re: [SOLVED] Change terminal cursor colour

printf '\e]12;#1793d0\a'

\e is escape
12 is 12 (the ansii code for this action), https://www.xfree86.org/current/ctlseqs.html - search for "Change text cursor color to"
#1793d0 is the color, the archlinux bluyan (somewhere between blue and cyan)
\a is the bell

033 and 007 are just the integers for the escape and bell ascii's ("man ascii")

Edit:
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Last edited by seth (2023-05-21 19:42:46)

Offline

Board footer

Powered by FluxBB