diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-11 22:16:22 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-11 22:16:22 -0500 |
commit | 7f805f31b7a128f37f83e4b80fd89fb9dbf8563a (patch) | |
tree | 7ddb61be0b5647ce638ff95884cd315ba2c2f24e | |
parent | 165faf398ab2e00ebf18ad730f18b9277f612213 (diff) | |
download | nbsh-7f805f31b7a128f37f83e4b80fd89fb9dbf8563a.tar.gz nbsh-7f805f31b7a128f37f83e4b80fd89fb9dbf8563a.zip |
fix focus on process exit
-rw-r--r-- | src/state.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/state.rs b/src/state.rs index dd32c5c..5fb4548 100644 --- a/src/state.rs +++ b/src/state.rs @@ -185,7 +185,20 @@ impl State { self.scene = self.default_scene(self.focus, None).await; } crate::event::Event::ProcessExit => { - self.set_focus(Focus::Readline, None).await; + if let Some(idx) = self.focus_idx() { + let entry = self.history.entry(idx).await; + if !entry.running() { + self.set_focus( + if self.hide_readline { + Focus::Readline + } else { + Focus::Scrolling(Some(idx)) + }, + Some(entry), + ) + .await; + } + } } crate::event::Event::ClockTimer => {} crate::event::Event::Quit => { |