Repository navigation
Add option to disable cursor blinking - #20929
Mike Griese (zadjii-msft) wants to merge 3 commits into
Conversation
Add a resettable profile compatibility.allowCursorBlinking option. When disabled, enforce a steady cursor in the VT adapter across application requests, resets, buffer switches, and settings reloads while preserving shape and visibility controls.
| }, | ||
| "compatibility.allowCursorBlinking": { | ||
| "default": true, | ||
| "description": "Allows cursor blinking. When false, cursor blinking is forced off, including when applications request blinking with mode ?12 or DECSCUSR. Applications can still change the cursor shape or show and hide it.", |
There was a problem hiding this comment.
Even fewer words would be OK. Whole last sentence could go.
| <value>Allow the cursor to blink. When disabled, cursor blinking is forced off, even if applications request it. Applications can still change the cursor shape or show and hide it.</value> | ||
| <comment>Description for the cursor blinking compatibility toggle.</comment> |
There was a problem hiding this comment.
| <value>Allow the cursor to blink. When disabled, cursor blinking is forced off, even if applications request it. Applications can still change the cursor shape or show and hide it.</value> | |
| <comment>Description for the cursor blinking compatibility toggle.</comment> | |
| <value>Allow the cursor to blink. When disabled, cursor blinking is suppressed even if applications request it.</value> | |
| <comment>Description for the cursor blinking compatibility toggle.</comment> |
Even fewer words would be OK. Whole last sentence could go.
There was a problem hiding this comment.
also i am fond of suppressed, take or leave
| break; | ||
| case DispatchTypes::ModeParams::ATT610_StartCursorBlink: | ||
| _pages.ActivePage().Cursor().SetIsBlinking(enable); | ||
| _pages.ActivePage().Cursor().SetIsBlinking(enable && _optionalFeatures.test(OptionalFeature::CursorBlinking)); |
There was a problem hiding this comment.
I'm not sure if I'm misunderstanding this, but this seems wrong to me. If the CursorBlinking feature is false, that just means it can't be changed, not that it must be off. If the default is on, and you try and turn it on (while CursorBlinking is false), this code would assumedly turn it off! I would have expected something like:
if (optionalFeatures.test(OptionalFeature::CursorBlinking))
_pages.ActivePage().Cursor().SetIsBlinking(enable);| state = _optionalFeatures.test(OptionalFeature::CursorBlinking) ? | ||
| mapTemp(_pages.ActivePage().Cursor().IsBlinking()) : | ||
| mapPerm(false); |
There was a problem hiding this comment.
This may be something you can't do until #20928 is merged, but I'm assuming the mapPerm(false) should actually be reporting whatever the user's default preference is. Although in theory that could also just be _pages.ActivePage().Cursor().IsBlinking() (if it can't be changed it should already be set to the default).
|
|
||
| // Restore cursor blinking mode. | ||
| _pages.ActivePage().Cursor().SetIsBlinking(true); | ||
| _pages.ActivePage().Cursor().SetIsBlinking(_optionalFeatures.test(OptionalFeature::CursorBlinking)); |
There was a problem hiding this comment.
Again this should assumedly be the user's default preference (what you've got in #20928).
| auto& cursor = _pages.ActivePage().Cursor(); | ||
| cursor.SetType(actualType); | ||
| cursor.SetIsBlinking(fEnableBlinking); | ||
| cursor.SetIsBlinking(fEnableBlinking && _optionalFeatures.test(OptionalFeature::CursorBlinking)); |
There was a problem hiding this comment.
Similar to the ATT610_StartCursorBlink case, I think this needs to be an if, so it's left unchanged if the feature is disabled.
| _pages.ActivePage().Cursor().SetIsBlinking(false); | ||
| _pages.VisiblePage().Cursor().SetIsBlinking(false); |
There was a problem hiding this comment.
I'm guessing these would need to be _api.GetUserDefaultCursorStyle().second once #20928 is merged?
| // Re-entering the alternate buffer can copy an older state from the main buffer. | ||
| if (!_optionalFeatures.test(OptionalFeature::CursorBlinking)) | ||
| { | ||
| _pages.ActivePage().Cursor().SetIsBlinking(false); | ||
| } |
There was a problem hiding this comment.
Not sure, but I think this should also be the user default.
This PR adds support for a new per-profile core setting,
compatibility.allowCursorBlinking$profile.compatibility.allowCursorBlinking: bool, defaulttrue.Following j4james' advice in #20815 (comment), this is implemented down in
adaptDispatch. That way, VT queries for the cursor state also show if cursor blinking is enabled or not.When paired with
default-cursor-blinkingin #20928, we can get all of the following states:compatibility.allowCursorBlinkingcursorBlinking: truecursorBlinking: falsetruefalseSupersedes #20815
Closes #1379 (in tandem with #20928)