From e2a66c4f1cb7fc1a09d42331f4e20152a5c26858 Mon Sep 17 00:00:00 2001 From: David Teresi <34610081+dkter@users.noreply.github.com> Date: Mon, 30 Dec 2019 09:28:54 -0500 Subject: [PATCH] Immediately show the cursor on terminal focus (#4032) ## Summary of the Pull Request Before, when a terminal window was focused, the blinking cursor would initially be hidden. This PR will immediately show the cursor when the window is focused, making it easier to keep track of the cursor. ## References #3761 ## PR Checklist * [x] Closes #3761 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments I guess I'm the cursor guy now ## Validation Steps Performed * Switched rapidly between different panes, different tabs and focused and unfocused the main window repeatedly. --- src/cascadia/TerminalControl/TermControl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 69d76f6b5ed..7ee68a6da3f 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -1342,6 +1342,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation if (_cursorTimer.has_value()) { + // When the terminal focuses, show the cursor immediately + _terminal->SetCursorVisible(true); _cursorTimer.value().Start(); } }