Skip to content

Commit

Permalink
Merge pull request #1686 from contour-terminal/fix/backtab_handling
Browse files Browse the repository at this point in the history
Fix backtab pty.output generation
  • Loading branch information
Yaraslaut authored Dec 30, 2024
2 parents 04b9dfc + 381d472 commit e4992cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
<li>Do not abort when failing to create `XDG_STATE_HOME/contour/crash` directory</li>
<li>Fixes tab switch crash after resize</li>
<li>Fixes tab shrinking after tab creation/switches when a non-zero horizontal window margin is configured</li>
<li>Fixes backtab (Shift+Tab) handling (#1685)</li>
</ul>
</description>
</release>
Expand Down
3 changes: 2 additions & 1 deletion src/vtbackend/InputGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ bool StandardKeyboardInputGenerator::generateChar(char32_t characterEvent,
return true;
}

// Backtab handling, 0x09 is Tab
if (modifiers == Modifier::Shift && characterEvent == 0x09)
{
append("\033[Z"); // introduced by linux_console in 1995, adopted by xterm in 2002
Expand Down Expand Up @@ -175,7 +176,7 @@ bool StandardKeyboardInputGenerator::generateKey(Key key, Modifiers modifiers, K
case Key::F35: append(select(modifiers, { .std = CSI "49~", .mods = CSI "49;{}~" })); break;
case Key::Escape: append("\033"); break;
case Key::Enter: append(select(modifiers, { .std = "\r" })); break;
case Key::Tab: append(select(modifiers, { .std = "\t" })); break;
case Key::Tab: generateChar('\t', 0, modifiers, eventType); break;
case Key::Backspace:
// Well accepted hack to distinguish between Backspace nad Ctrl+Backspace,
// - Backspace is emitting 0x7f,
Expand Down

0 comments on commit e4992cf

Please sign in to comment.