mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 05:42:03 +03:00
term: propagate wezterm debug_key_events config
Log the sequence being sent to the terminal when enabled.
This commit is contained in:
parent
51aec27ec2
commit
dc204c03d6
@ -78,4 +78,8 @@ impl wezterm_term::TerminalConfiguration for TermConfig {
|
||||
fn unicode_version(&self) -> u8 {
|
||||
self.configuration().unicode_version
|
||||
}
|
||||
|
||||
fn debug_key_events(&self) -> bool {
|
||||
self.configuration().debug_key_events
|
||||
}
|
||||
}
|
||||
|
@ -95,4 +95,8 @@ pub trait TerminalConfiguration: std::fmt::Debug {
|
||||
fn unicode_version(&self) -> u8 {
|
||||
9
|
||||
}
|
||||
|
||||
fn debug_key_events(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,11 @@ impl TerminalState {
|
||||
},
|
||||
)?;
|
||||
|
||||
log::trace!("sending {:?}, {:?}", to_send, key);
|
||||
if self.config.debug_key_events() {
|
||||
log::info!("key_down: sending {:?}, {:?} {:?}", to_send, key, mods);
|
||||
} else {
|
||||
log::trace!("key_down: sending {:?}, {:?} {:?}", to_send, key, mods);
|
||||
}
|
||||
self.writer.write_all(to_send.as_bytes())?;
|
||||
self.writer.flush()?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user