diff --git a/docs/changelog.md b/docs/changelog.md index 919432123..c97d3abc6 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -51,6 +51,7 @@ As features stabilize some brief notes about them will accumulate here. * Quickselect: now selects the bottom-most match rather than the top-most match. [#2250](https://github.com/wez/wezterm/issues/2250) * Mux: `wezterm.mux.set_active_workspace` didn't update the current window to match the newly activated workspace. [#2248](https://github.com/wez/wezterm/issues/2248) * Overlays such as debug and launcher menu now handle resize better +* Shift-F1 through F4 generated different encoding than xterm [#2263](https://github.com/wez/wezterm/issues/2263) #### Updated * Bundled harfbuzz to 4.4.1 diff --git a/termwiz/src/input.rs b/termwiz/src/input.rs index 6e955fe63..ce5463132 100644 --- a/termwiz/src/input.rs +++ b/termwiz/src/input.rs @@ -661,9 +661,18 @@ impl KeyCode { _ => unreachable!("wat?"), } )?; + } else if n < 5 { + // Special case for F1-F4 with modifiers + let code = match n { + 1 => 'P', + 2 => 'Q', + 3 => 'R', + 4 => 'S', + _ => unreachable!("wat?"), + }; + write!(buf, "\x1b[1;{}{code}", 1 + encode_modifiers(mods))?; } else { - // Higher numbered F-keys plus modified F-keys are encoded - // using CSI instead of SS3. + // Higher numbered F-keys using CSI instead of SS3. let intro = match n { 1 => "\x1b[11", 2 => "\x1b[12",