Skip to content

Add a default cursor blinking preference - #20928

Open
Mike Griese (zadjii-msft) wants to merge 6 commits into
mainfrom
dev/migrie/b/default-cursor-blinking
Open

Mike Griese (zadjii-msft) wants to merge 6 commits into
mainfrom
dev/migrie/b/default-cursor-blinking

Conversation

@zadjii-msft

@zadjii-msft Mike Griese (zadjii-msft) commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

This PR adds support for a new per-profile setting, cursorBlinking:
$profile.cursorBlinking: bool, default true.

  • When enabled, the "default" cursor state is blinking. This is what we have today.
  • When disabled, the default becomes "solid", non-blinking cursor.

This only controls the default cursor state, though. Apps are totally free to then still set this themselves to enable / disable blinking at runtime.
Essentially, it turns DECSCUSR into the following:

Ps Cursor Style
0, 1 or none DEFAULT BLINK & Shape
2 Steady Block
3 Blink Underline
4 Steady Underline

where DEFAULT BLINK == cursorBlinking ? "Blink" : "Steady".

This is from j4james' advice in #20815 (comment).

Supersedes #20815
Closes #1379 (in tandem with #20929)

Add the inheritable cursorBlinking appearance setting and resettable settings UI. Restore the preference for DECSCUSR 0 and RIS while retaining application control and preserving unchanged blinking state across settings reloads.
@microsoft-github-policy-service microsoft-github-policy-service Bot added Issue-Task It's a feature request, but it doesn't really need a major design. Area-Settings Issues related to settings and customizability, for console or terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Priority-2 A description (P2) Product-Terminal The new Windows Terminal. labels Nov 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm... this one feels a little less baked to me

Comment thread src/cascadia/TerminalCore/Terminal.cpp Resolved

@lhecker Leonard Hecker (lhecker) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling this cannot work due to the way you override the VT cursor blinking state.

}

_terminal->Create(viewportSize, _settings.HistorySize(), *_renderer);
_terminal->Create(viewportSize, _settings.HistorySize(), *_renderer, _settings.CursorBlinking());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should handle this in UpdateSettings() no?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but Terminal::Create() creates a new TextBuffer, and we need the default blinking state then. UpdateSettings is already too late. And like, you could just force UpdateSettings() to reset the cursor blinking to the default, but then I think folks would get mad at us for resetting the cursor blinking when they're in an application that turned it off/on on them purposfully.

{
UpdateAppearance(settings);

_defaultCursorBlinking = settings.CursorBlinking();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically missing SetIsBlinking.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I actually specifically didn't do that. We don't really know right now if the blinking is because an app asked for blinking, or if it's because we're in the default state.
We can't just blindly set our current blinking state to the default, because an app might have explicitly asked for one or the other.

Kinda creates an issue where the setting won't hot-reload until someone changes the cursor blink state, but also I thought that was preferable to everyone who's hitting #11522 also whinging about the cursor blinking resetting

@j4james

Copy link
Copy Markdown
Collaborator

Just based on a brief scan, the code looks right to me, but the PR description looks wrong. My understanding is that the DECUSR table now looks like this:

Ps Cursor Style
0 or none DEFAULT BLINK & SHAPE
1 Blink Block
2 Steady Block
3 Blink Underline
4 Steady Underline

We've always had 0/none apply the default cursor shape, but it's now also applying the default blinking preference.

@zadjii-msft

Copy link
Copy Markdown
Member Author

James Holderness (@j4james) good catch, I clearly forgot that we have a different default cursor and have for like, a decade now

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

Labels

Area-Settings Issues related to settings and customizability, for console or terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for turning off cursor blink

4 participants