[PR #17154] Update so that cursor size/type/isblinkingallowed get restored when switching back to main buffer from alt buffer #31134

Open
opened 2026-01-31 09:45:19 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/17154

State: closed
Merged: No


Summary of the Pull Request

When switching to a application that uses the alt buffer, the cursor continues to use the alt buffer applications cursor type when switched back to the main buffer.

I think that this is from this logic in Terminal::UseMainScreenBuffer().
378b6594bd/src/cascadia/TerminalCore/TerminalApi.cpp (L276-L287)

Based on these comments, I made the updates in AdaptDispatch::CursorRestoreState where it looked like it was restoring the cursor position.
378b6594bd/src/cascadia/TerminalCore/TerminalApi.cpp (L271-L275)
91fed9ca3c/src/terminal/adapter/adaptDispatch.cpp (L540)

BlockCursor

References and Relevant Issues

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

PR Checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)
**Original Pull Request:** https://github.com/microsoft/terminal/pull/17154 **State:** closed **Merged:** No --- ## Summary of the Pull Request When switching to a application that uses the alt buffer, the cursor continues to use the alt buffer applications cursor type when switched back to the main buffer. I think that this is from this logic in Terminal::UseMainScreenBuffer(). https://github.com/microsoft/terminal/blob/378b6594bd94cf3b27f4e309a11efe25d83de0d9/src/cascadia/TerminalCore/TerminalApi.cpp#L276-L287 Based on these comments, I made the updates in AdaptDispatch::CursorRestoreState where it looked like it was restoring the cursor position. https://github.com/microsoft/terminal/blob/378b6594bd94cf3b27f4e309a11efe25d83de0d9/src/cascadia/TerminalCore/TerminalApi.cpp#L271-L275 https://github.com/e82eric/terminal/blob/91fed9ca3c7b9a89612a7ab9569330a642684a84/src/terminal/adapter/adaptDispatch.cpp#L540 ![BlockCursor](https://github.com/microsoft/terminal/assets/811029/7d7940e4-ecb6-4baf-ab00-f120f1e874d8) ## References and Relevant Issues ## Detailed Description of the Pull Request / Additional comments ## Validation Steps Performed ## PR Checklist - [ ] Closes #xxx - [ ] Tests added/passed - [ ] Documentation updated - If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx - [ ] Schema updated (if necessary)
claunia added the pull-request label 2026-01-31 09:45:19 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31134