mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 13:52:55 +03:00
term: fix representation of unmodified F5+
We were unconditionally adding the encoded form of the modifier mask (eg: appending `;1~` to the sequence) and not all apps know how to interpret that. refs: https://github.com/wez/wezterm/issues/227
This commit is contained in:
parent
fded650ccb
commit
59ca0da7ad
@ -39,6 +39,8 @@ brief notes about them may accumulate here.
|
|||||||
* Improved terminal emulation conformance; added left/right margin support
|
* Improved terminal emulation conformance; added left/right margin support
|
||||||
and now passes [esctest](https://gitlab.freedesktop.org/terminal-wg/esctest)
|
and now passes [esctest](https://gitlab.freedesktop.org/terminal-wg/esctest)
|
||||||
to a similar degree as iTerm2
|
to a similar degree as iTerm2
|
||||||
|
* Fixed an issue where unmodified F5+ would use the CSI-u encoded-modifiers
|
||||||
|
format, and confused eg: `htop`.
|
||||||
|
|
||||||
### 20200607-144723-74889cd4
|
### 20200607-144723-74889cd4
|
||||||
|
|
||||||
|
@ -905,7 +905,14 @@ impl TerminalState {
|
|||||||
12 => "\x1b[24",
|
12 => "\x1b[24",
|
||||||
_ => bail!("unhandled fkey number {}", n),
|
_ => bail!("unhandled fkey number {}", n),
|
||||||
};
|
};
|
||||||
write!(buf, "{};{}~", intro, 1 + encode_modifiers(mods))?;
|
let encoded_mods = encode_modifiers(mods);
|
||||||
|
if encoded_mods == 0 {
|
||||||
|
// If no modifiers are held, don't send the modifier
|
||||||
|
// sequence, as the modifier encoding is a CSI-u extension.
|
||||||
|
write!(buf, "{}~", intro)?;
|
||||||
|
} else {
|
||||||
|
write!(buf, "{};{}~", intro, 1 + encoded_mods)?;
|
||||||
|
}
|
||||||
buf.as_str()
|
buf.as_str()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user