Repository navigation
Add a default cursor blinking preference - #20928
Mike Griese (zadjii-msft) wants to merge 6 commits into
Conversation
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.
Dustin L. Howett (DHowett)
left a comment
There was a problem hiding this comment.
hmm... this one feels a little less baked to me
Leonard Hecker (lhecker)
left a comment
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
You should handle this in UpdateSettings() no?
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
This is technically missing SetIsBlinking.
There was a problem hiding this comment.
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
|
Just based on a brief scan, the code looks right to me, but the PR description looks wrong. My understanding is that the
We've always had 0/none apply the default cursor shape, but it's now also applying the default blinking preference. |
|
James Holderness (@j4james) good catch, I clearly forgot that we have a different default cursor and have for like, a decade now |
This PR adds support for a new per-profile setting,
cursorBlinking:$profile.cursorBlinking: bool, defaulttrue.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
DECSCUSRinto the following:where DEFAULT BLINK ==
cursorBlinking ? "Blink" : "Steady".This is from j4james' advice in #20815 (comment).
Supersedes #20815
Closes #1379 (in tandem with #20929)