Skip to content

Conversation

@dabeibao
Copy link

The escape sequence is:
ESC[N q

N is between 0 and 6.

The escape sequence is:
    ESC[N q

N is between 0 and 6.
@achernya
Copy link
Collaborator

What is the context of this?

@dabeibao
Copy link
Author

dabeibao commented Oct 17, 2025

Please see the link:
https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797?permalink_comment_id=5165100#gistcomment-5165100

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).

Normal mode:
图片

Insert mode:
图片

@achernya
Copy link
Collaborator

Is there any more authoritative documentation of these escape sequences?

@dabeibao
Copy link
Author

What about this: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html

Search 'CSI Ps SP q' in the page:

CSI Ps SP q
          Set cursor style (DECSCUSR), VT520.
            Ps = 0  ⇒  blinking block.
            Ps = 1  ⇒  blinking block (default).
            Ps = 2  ⇒  steady block.
            Ps = 3  ⇒  blinking underline.
            Ps = 4  ⇒  steady underline.
            Ps = 5  ⇒  blinking bar, xterm.
            Ps = 6  ⇒  steady bar, xterm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants