diff options
| author | Jonas Maier <> | 2026-05-24 12:52:44 +0200 |
|---|---|---|
| committer | Jonas Maier <> | 2026-05-24 12:52:44 +0200 |
| commit | 183aee63b56be098efad606df9cf39ae637c4117 (patch) | |
| tree | a80f65eca7368e3999e1f880e928b0bdb685d2ef /src/run | |
| parent | 36cbfcaafcb8a3b1c47650439531a35c99b203ea (diff) | |
| download | pish-183aee63b56be098efad606df9cf39ae637c4117.tar.gz | |
add logic to query cursor position
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)?; |
