diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 4f14aba020e..b6df41e3772 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -732,8 +732,16 @@ namespace winrt::Microsoft::Terminal::Control::implementation _cursorTimer.emplace(std::move(cursorTimer)); // As of GH#6586, don't start the cursor timer immediately, and // don't show the cursor initially. We'll show the cursor and start - // the timer when the control is first focused. cursorTimer.Start(); - _core.CursorOn(false); + // the timer when the control is first focused. + // + // As of GH#11411, turn on the cursor if we've already been marked + // as focused. We suspect that it's possible for the Focused event + // to fire before the LayoutUpdated. In that case, the + // _GotFocusHandler would mark us _focused, but find that a + // _cursorTimer doesn't exist, and it would never turn on the + // cursor. To mitigate, we'll initialize the cursor's 'on' state + // with `_focused` here. + _core.CursorOn(_focused); } else {