mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
Previously, making the cursor visible with DECTCEM caused the cursor to reset its appearance to the shape that was set before the last DECTCEM command making it invisible. However, the cursor shape could have been changed between those two commands (or the cursor could have never been made invisible before), causing us to display an incorrect cursor shape. Instead of (incorrectly) keeping track of the old cursor shape in `m_saved_cursor_shape`, let's simplify this code by introducing a `set_cursor_hidden` function, which is used by `TerminalWidget` to set its `m_cursor_is_hidden` variable to enable/disable drawing of the cursor. This causes neovim to display the bar cursor shape in insert mode. Previously, it displayed the block shape since it always issues a "set cursor visible" command after setting the cursor shape, therefore we incorrectly reset the shape to a block cursor.