term: fixup ctrl+ ambiguous ctrl code representation

This was originally intended to be swept in and dealt with as part of
adopting CSI-u (refs: https://github.com/wez/wezterm/issues/63) but the
default shift-space mapping is super irritating in vim (refs:
https://github.com/wez/wezterm/issues/126) so it got partially walked
back, but as a consequence we accidentally dropped the modifiers from
those keys (refs: https://github.com/wez/wezterm/issues/213 refs:
https://github.com/wez/wezterm/issues/214).

This commit restores the modifiers for that case.

In addition, since we now have a way to plumb configuration directly
into the term crate, this adds a config option to enable CSI-u for those
that want to use it.
This commit is contained in:
Wez Furlong committed 2020-06-10 17:07:30 -07:00
1 parent afe0475ced
commit 9f1303fb8e
5 files changed
+48 -23

No files matched your search

+7
View File
@@ -519,6 +519,13 @@ pub struct Config {
#[serde(default = "default_update_interval")]
pub check_for_updates_interval_seconds: u64,
/// When set to true, use the CSI-U encoding scheme as described
/// in http://www.leonerd.org.uk/hacks/fixterms/
/// This is off by default because @wez and @jsgf find the shift-space
/// mapping annoying in vim :-p
#[serde(default)]
pub enable_csi_u_key_encoding: bool,
}
fn default_update_interval() -> u64 {
+4
View File
@@ -21,6 +21,10 @@ impl term::TerminalConfiguration for TermConfig {
(config.generation(), config.hyperlink_rules.clone())
}
fn enable_csi_u_key_encoding(&self) -> bool {
configuration().enable_csi_u_key_encoding
}
fn color_palette(&self) -> ColorPalette {
let config = configuration();