term: propagate wezterm debug_key_events config
Log the sequence being sent to the terminal when enabled.
This commit is contained in:
1 parent
51aec27ec2
commit
dc204c03d6
3 files changed
+13
-1
No files matched your search
@@ -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()?;
|
||||
|
||||
|
||||
Reference in new issue
Block a user