Skip to content

Commit 7963c6d

Browse files
Merge pull request #1106 from contour-terminal/fix/cursor-shape-in-vi-modes
fixes cursor configuration updates when changing input mode
2 parents 049f21d + ae4bae3 commit 7963c6d

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

metainfo.xml

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
<li>Fixes statusline being misplaced after resize when being in alt screen (#1091).</li>
115115
<li>Fixes hyperlinks with IDs (#1088)</li>
116116
<li>Fixes hyperlink highlight when screen has been scrolled (#1084)</li>
117+
<li>Fixes cursor shape changes when entering vi-like normal mode or visual mode.</li>
117118
<li>Improves mouse selection to be more natural extending into new grid cells.</li>
118119
<li>Modal mode: Improves how `[m` jumps from the current prompt to the next prompt above it.</li>
119120
<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>

src/contour/Config.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,9 @@ namespace
620620
return nullopt;
621621
}
622622

623-
optional<config::CursorConfig> parseCursorConfig(YAML::Node rootNode,
623+
optional<config::CursorConfig> parseCursorConfig(YAML::Node const& rootNode,
624624
UsedKeys& usedKeys,
625-
std::string basePath)
625+
std::string const& basePath)
626626
{
627627
if (!rootNode)
628628
return nullopt;
@@ -1693,7 +1693,7 @@ namespace
16931693
parseCursorConfig(visualModeNode["cursor"], _usedKeys, basePath + ".visual_mode.cursor"))
16941694
{
16951695
_usedKeys.emplace(basePath + ".visual_mode.cursor");
1696-
profile.inputModes.normal.cursor = cursorOpt.value();
1696+
profile.inputModes.visual.cursor = cursorOpt.value();
16971697
}
16981698
}
16991699

src/contour/TerminalSession.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,10 @@ void TerminalSession::configureCursor(config::CursorConfig const& cursorConfig)
11901190
terminal_.setCursorBlinkingInterval(cursorConfig.cursorBlinkInterval);
11911191
terminal_.setCursorDisplay(cursorConfig.cursorDisplay);
11921192
terminal_.setCursorShape(cursorConfig.cursorShape);
1193+
1194+
// Force a redraw of the screen
1195+
// to ensure the correct cursor shape is displayed.
1196+
scheduleRedraw();
11931197
}
11941198

11951199
void TerminalSession::configureDisplay()

0 commit comments

Comments
 (0)