Skip to content

Commit

Permalink
Merge pull request #1106 from contour-terminal/fix/cursor-shape-in-vi…
Browse files Browse the repository at this point in the history
…-modes

fixes cursor configuration updates when changing input mode
  • Loading branch information
christianparpart authored May 26, 2023
2 parents 049f21d + ae4bae3 commit 7963c6d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
<li>Fixes statusline being misplaced after resize when being in alt screen (#1091).</li>
<li>Fixes hyperlinks with IDs (#1088)</li>
<li>Fixes hyperlink highlight when screen has been scrolled (#1084)</li>
<li>Fixes cursor shape changes when entering vi-like normal mode or visual mode.</li>
<li>Improves mouse selection to be more natural extending into new grid cells.</li>
<li>Modal mode: Improves how `[m` jumps from the current prompt to the next prompt above it.</li>
<li>Adds `profiles.*.permissions.display_host_writable_statusline` to allow the user to intervene in `DECSSDT 2` VT sequence to show the host writable statusline.</li>
Expand Down
6 changes: 3 additions & 3 deletions src/contour/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,9 @@ namespace
return nullopt;
}

optional<config::CursorConfig> parseCursorConfig(YAML::Node rootNode,
optional<config::CursorConfig> parseCursorConfig(YAML::Node const& rootNode,
UsedKeys& usedKeys,
std::string basePath)
std::string const& basePath)
{
if (!rootNode)
return nullopt;
Expand Down Expand Up @@ -1693,7 +1693,7 @@ namespace
parseCursorConfig(visualModeNode["cursor"], _usedKeys, basePath + ".visual_mode.cursor"))
{
_usedKeys.emplace(basePath + ".visual_mode.cursor");
profile.inputModes.normal.cursor = cursorOpt.value();
profile.inputModes.visual.cursor = cursorOpt.value();
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/contour/TerminalSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,10 @@ void TerminalSession::configureCursor(config::CursorConfig const& cursorConfig)
terminal_.setCursorBlinkingInterval(cursorConfig.cursorBlinkInterval);
terminal_.setCursorDisplay(cursorConfig.cursorDisplay);
terminal_.setCursorShape(cursorConfig.cursorShape);

// Force a redraw of the screen
// to ensure the correct cursor shape is displayed.
scheduleRedraw();
}

void TerminalSession::configureDisplay()
Expand Down

0 comments on commit 7963c6d

Please sign in to comment.