[PR #4902] [MERGED] Add support for setting the cursor visibility in Terminal #26013

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4902
Author: @zadjii-msft
Created: 3/13/2020
Status: ✅ Merged
Merged: 3/13/2020
Merged by: @undefined

Base: master ← Head: dev/migrie/b/3093-terminal-cursor-visibility


📝 Commits (3)

  • 73e23d3 Enable the terminal to set the cursor's visibility.
  • bce86fb man tests are great
  • 04540a8 fix typo, and pls SA

📊 Changes

9 files changed (+236 additions, -91 deletions)

View changed files

📝 src/cascadia/PublicTerminalCore/HwndTerminal.cpp (+2 -2)
📝 src/cascadia/TerminalControl/TermControl.cpp (+4 -4)
📝 src/cascadia/TerminalCore/ITerminalApi.hpp (+2 -0)
📝 src/cascadia/TerminalCore/Terminal.cpp (+7 -4)
📝 src/cascadia/TerminalCore/Terminal.hpp (+5 -1)
📝 src/cascadia/TerminalCore/TerminalApi.cpp (+20 -0)
📝 src/cascadia/TerminalCore/TerminalDispatch.cpp (+16 -0)
📝 src/cascadia/TerminalCore/TerminalDispatch.hpp (+3 -0)
📝 src/cascadia/UnitTests_TerminalCore/TerminalApiTest.cpp (+177 -80)

📄 Description

Adds support for setting the cursor visibility in Terminal. Visibility
is a property entirely independent from whether the cursor is "on" or
not. The cursor blinker should change the "IsOn" property. It was
actually changing the "Visible" property, which was incorrect. This PR
additionally corrects the naming of the method used by the cursor
blinker, and makes it do the right thing.

I added a pair of tests, one taken straight from conhost. In
copy-pasting that test, I took it a step further and implemented
^[[?12h, ^[[?12l, which enables/disables cursor blinking, for the
TerminalCore. THIS DOES NOT ADD SUPPORT FOR DISABLING BLINKING IN THE
APP. Conpty doesn't emit the blinking on/off sequences quite yet, but
when it does, the Terminal will be ready.

References

  • I'd bet this conflicts with #2892
  • This isn't a solution for #1379
  • There shockingly isn't an issue for cursor blink state via conpty...?

PR Checklist


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4902 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 3/13/2020 **Status:** ✅ Merged **Merged:** 3/13/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/migrie/b/3093-terminal-cursor-visibility` --- ### 📝 Commits (3) - [`73e23d3`](https://github.com/microsoft/terminal/commit/73e23d34b4533c18adba1bc911ef0c407f15ae17) Enable the terminal to set the cursor's visibility. - [`bce86fb`](https://github.com/microsoft/terminal/commit/bce86fb9c16dd5d2214c42029cf5abc80701d061) man tests are great - [`04540a8`](https://github.com/microsoft/terminal/commit/04540a80b521078e9391aa55ba0067fc89717d64) fix typo, and pls SA ### 📊 Changes **9 files changed** (+236 additions, -91 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/PublicTerminalCore/HwndTerminal.cpp` (+2 -2) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+4 -4) 📝 `src/cascadia/TerminalCore/ITerminalApi.hpp` (+2 -0) 📝 `src/cascadia/TerminalCore/Terminal.cpp` (+7 -4) 📝 `src/cascadia/TerminalCore/Terminal.hpp` (+5 -1) 📝 `src/cascadia/TerminalCore/TerminalApi.cpp` (+20 -0) 📝 `src/cascadia/TerminalCore/TerminalDispatch.cpp` (+16 -0) 📝 `src/cascadia/TerminalCore/TerminalDispatch.hpp` (+3 -0) 📝 `src/cascadia/UnitTests_TerminalCore/TerminalApiTest.cpp` (+177 -80) </details> ### 📄 Description Adds support for setting the cursor visibility in Terminal. Visibility is a property entirely independent from whether the cursor is "on" or not. The cursor blinker _should_ change the "IsOn" property. It was actually changing the "Visible" property, which was incorrect. This PR additionally corrects the naming of the method used by the cursor blinker, and makes it do the right thing. I added a pair of tests, one taken straight from conhost. In copy-pasting that test, I took it a step further and implemented `^[[?12h`, `^[[?12l`, which enables/disables cursor blinking, for the `TerminalCore`. THIS DOES NOT ADD SUPPORT FOR DISABLING BLINKING IN THE APP. Conpty doesn't emit the blinking on/off sequences quite yet, but when it _does_, the Terminal will be ready. ## References * I'd bet this conflicts with #2892 * This isn't a solution for #1379 * There shockingly isn't an issue for cursor blink state via conpty...? ## PR Checklist * [x] Closes #3093 * [x] Closes #3499 * [x] Closes #4644 * [x] I work here * [x] Tests added/passed * [n/a] Requires documentation to be updated --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:13:21 +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#26013