diff options
Diffstat (limited to 'src/run')
| -rw-r--r-- | src/run/builtin.rs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/run/builtin.rs b/src/run/builtin.rs index dfafcbe..fab7565 100644 --- a/src/run/builtin.rs +++ b/src/run/builtin.rs @@ -622,12 +622,15 @@ impl Builtin for bind { "bind" } - fn special(&mut self, _session: Arc<Mutex<Session>>, args: &[BString]) { + fn special(&mut self, session: Arc<Mutex<Session>>, args: &[BString]) { if Self::is_interactive(args) { - let raw = crate::raw::ScopedRawMode::on_fd(0); - raw.enable(); - self.key = crate::ansi::read(false); - raw.disable(); + let mut se = session.lock().unwrap(); + if let Some(ti) = se.terminal_input.as_mut() { + let raw = crate::raw::ScopedRawMode::on_fd(0); + raw.enable(); + self.key = ti.read(); + raw.disable(); + } } } @@ -1056,7 +1059,11 @@ mod dbg { let mut se = session.lock().unwrap(); for arg in args { match &arg[..] { - b"keys" | b"keystrokes" => se.debug_keystrokes = !se.debug_keystrokes, + b"keys" | b"keystrokes" => { + if let Some(ti) = se.terminal_input.as_mut() { + ti.debug = !ti.debug; + } + } _ => { stdout.write_all(b"debug: unknown option ")?; stdout.write_all(&arg)?; |
