Skip to content

Commit 99110ce

Browse files
Merge pull request #1807 from contour-terminal/fix/fish-shell-CSIu
Adapts CSIu input protocol to match how recent fish shell implementation transmits it.
2 parents eb961e0 + 3dc2337 commit 99110ce

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

metainfo.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
<li>Fixes double line box drawing characters</li>
121121
<li>Fixes DECRQM (DEC Request Mode) response (#1797)</li>
122122
<li>Fixes Precondition failure when rendering vertically overflowing glyphs (#1805)</li>
123+
<li>Fixes fish-shell keyboard input protocol behaviour; acting as if it would be broken on e.g. control keys (weird handling of CSIu input protocol)</li>
123124
<li>Enables customizing predefined color palette (#1763)</li>
124125
<li>Ensure inserting new tabs happens right next to the currently active tab (#1695)</li>
125126
<li>Allow glyphs to underflow if they are not bigger than the cell size (#1603)</li>

src/vtbackend/Functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ constexpr inline auto CHA = detail::CSI(std::nullopt, 0, 1, std::nullopt
517517
constexpr inline auto CHT = detail::CSI(std::nullopt, 0, 1, std::nullopt, 'I', VTType::VT100, documentation::CHT);
518518
constexpr inline auto CNL = detail::CSI(std::nullopt, 0, 1, std::nullopt, 'E', VTType::VT100, documentation::CNL);
519519
constexpr inline auto CPL = detail::CSI(std::nullopt, 0, 1, std::nullopt, 'F', VTType::VT100, documentation::CPL);
520-
constexpr inline auto CSIUENHCE = detail::CSI('=', 1, 2, std::nullopt, 'u', VTExtension::Unknown, documentation::CSIUENHCE);
520+
constexpr inline auto CSIUENHCE = detail::CSI('=', 0, 2, std::nullopt, 'u', VTExtension::Unknown, documentation::CSIUENHCE);
521521
constexpr inline auto CSIUENTER = detail::CSI('>', 0, 1, std::nullopt, 'u', VTExtension::Unknown, documentation::CSIUENTER);
522522
constexpr inline auto CSIULEAVE = detail::CSI('<', 0, 1, std::nullopt, 'u', VTExtension::Unknown, documentation::CSIULEAVE);
523523
constexpr inline auto CSIUQUERY = detail::CSI('?', 0, 0, std::nullopt, 'u', VTExtension::Unknown, documentation::CSIUQUERY);

src/vtbackend/Screen.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3636,10 +3636,9 @@ ApplyResult Screen<Cell>::apply(Function const& function, Sequence const& seq)
36363636
return ApplyResult::Ok;
36373637
}
36383638
case CSIUENHCE: {
3639-
auto const flags = KeyboardEventFlags::from_value(seq.param_or(0, 1));
3639+
// Defaulting flags to 0. (Seems not to be documented by the spec, but Fish shell is doing that!)
3640+
auto const flags = KeyboardEventFlags::from_value(seq.param_or(0, 0));
36403641
auto const mode = seq.param_or(1, 1);
3641-
if (_terminal->keyboardProtocol().stackDepth() <= 1)
3642-
return ApplyResult::Invalid;
36433642
switch (mode)
36443643
{
36453644
case 1: _terminal->keyboardProtocol().flags() = flags; return ApplyResult::Ok;

0 commit comments

Comments
 (0)