This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to set cursor to blinking in Konsole from script or vim?

Tags: None
(comma "," separated)
shmerl
Registered Member
Posts
251
Karma
1
OS
Konsole supports changing cursor shape with escape sequences like this:

Code: Select all
# block
printf "\e]50;CursorShape=0\x7"
# bar
printf "\e]50;CursorShape=1\x7"
# underscore
printf "\e]50;CursorShape=2\x7"


In vim one can set them to at least insert and other modes like this:

Code: Select all
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
let &t_SI = "\<Esc>]50;CursorShape=1\x7"


But is there any way to make cursor blink from scripts or in vim? That could be very useful.
luebking
Karma
0
Code: Select all
printf "\e]50;BlinkingCursorEnabled=0\x7"
printf "\e]50;BlinkingCursorEnabled=1\x7"
shmerl
Registered Member
Posts
251
Karma
1
OS
luebking wrote:
Code: Select all
printf "\e]50;BlinkingCursorEnabled=0\x7"
printf "\e]50;BlinkingCursorEnabled=1\x7"


Perfect! Thanks. xterm though also supports DECSCUSR sequences (with two additional ones for vertical bars). Try this in xterm:

Code: Select all
# blinking block
printf '\e[1 q'
# steady block
printf '\e[2 q'
# blinking underscore
printf '\e[3 q'
# steady underscore
printf '\e[4 q'
# blinking bar
printf '\e[5 q'
# steady bar
printf '\e[6 q'


These are IMHO much simpler, and at least somewhat more standard. But for some reason Konsole doesn't support them. I added a comment here: https://bugs.kde.org/show_bug.cgi?id=103399

Do you think I should open a separate bug about it?
luebking
Karma
0
> Do you think I should open a separate bug about it?

Yes. The bug is long time set "fixed" because it was about supporting different cursor shapes in the first place (what's available)
shmerl
Registered Member
Posts
251
Karma
1
OS


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]