aboutsummaryrefslogtreecommitdiff
path: root/src/terminal_modes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/terminal_modes.rs')
-rw-r--r--src/terminal_modes.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/terminal_modes.rs b/src/terminal_modes.rs
index 90ec512b..5b6a5d3b 100644
--- a/src/terminal_modes.rs
+++ b/src/terminal_modes.rs
@@ -25,6 +25,11 @@ pub(crate) fn set_host_kitty_keyboard_report_all<W: Write>(
let mut flags = crate::input::ime_compatible_keyboard_enhancement_flags();
if report_all_keys {
flags |= crossterm::event::KeyboardEnhancementFlags::REPORT_ALL_KEYS_AS_ESCAPE_CODES;
+ // Report-all turns IME commits into CSI-u key events in terminals such
+ // as Ghostty. Ask the terminal to carry the committed text with them.
+ flags = crossterm::event::KeyboardEnhancementFlags::from_bits_retain(
+ flags.bits() | 0b0001_0000,
+ );
}
// Older iTerm2 releases clear the keyboard stack on SET, so a later pop
// cannot restore the host state. Replace only Herdr's top entry instead.
@@ -54,7 +59,7 @@ mod tests {
set_host_kitty_keyboard_report_all(&mut output, true).unwrap();
set_host_kitty_keyboard_report_all(&mut output, false).unwrap();
- assert_eq!(output, b"\x1b[<1u\x1b[>15u\x1b[<1u\x1b[>7u");
+ assert_eq!(output, b"\x1b[<1u\x1b[>31u\x1b[<1u\x1b[>7u");
}
#[test]