-
Notifications
You must be signed in to change notification settings - Fork 775
Cursor shape support #1355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Cursor shape support #1355
Conversation
The escape sequence is:
ESC[N q
N is between 0 and 6.
|
What is the context of this? |
|
Please see the link: Many modern terminals (including Windows Terminal, mintty, etc.) support changing the cursor shape dynamically — and this pairs beautifully with Emacs Evil mode, so you can visually distinguish between Normal and Insert modes (like in Vim). |
|
Is there any more authoritative documentation of these escape sequences? |
|
What about this: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html Search 'CSI Ps SP q' in the page: |
|
We have long standing PRs and issues for this feature. |
src/terminal/terminalfunctions.cc
Outdated
| /* cursor shape */ | ||
| static void CSI_cursorshape( Framebuffer* fb, Dispatcher* dispatch ) | ||
| { | ||
| int shape = dispatch->getparam( 0, -1 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking at the impl for Dispather::getparam and it looks like doesn't support returning values less than 1. But 0 is a valid cursor shape.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The defaultval should be 0.
Seems this commit already implements it. But the title is somewhat misleading... |
|
Something's still not quite right when the terminal is reset. Try this: printf '\x1b[6 q\x1bc' |


The escape sequence is:
ESC[N q
N is between 0 and 6.