summaryrefslogtreecommitdiffstats
path: root/src/state/history/mod.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-02 19:17:19 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-02 19:17:19 -0500
commitcc34cb675a53adeabf60d9687c1044780a8431a3 (patch)
tree25dadcb920add3cca9e10d33ec1772d6c5aa8046 /src/state/history/mod.rs
parent758cc746825770eff16bb7f6317297efd3cc0f27 (diff)
downloadnbsh-cc34cb675a53adeabf60d9687c1044780a8431a3.tar.gz
nbsh-cc34cb675a53adeabf60d9687c1044780a8431a3.zip
simplify
Diffstat (limited to 'src/state/history/mod.rs')
-rw-r--r--src/state/history/mod.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/state/history/mod.rs b/src/state/history/mod.rs
index 6263a1f..d2eb17c 100644
--- a/src/state/history/mod.rs
+++ b/src/state/history/mod.rs
@@ -93,21 +93,18 @@ impl History {
) -> anyhow::Result<usize> {
let (input_w, input_r) = async_std::channel::unbounded();
let (resize_w, resize_r) = async_std::channel::unbounded();
- let (close_w, close_r) = async_std::channel::unbounded();
let entry = async_std::sync::Arc::new(async_std::sync::Mutex::new(
Entry::new(Ok(ast.clone()), self.size, input_w, resize_w),
));
- let pty = pty::Pty::new(
- self.size, &entry, input_r, resize_r, close_r, event_w,
- )?;
+ let pty =
+ pty::Pty::new(self.size, &entry, input_r, resize_r, event_w)?;
run_commands(
ast.clone(),
pty,
async_std::sync::Arc::clone(&entry),
ProcessEnv::new(),
- close_w,
);
self.entries.push(entry);
@@ -570,7 +567,6 @@ fn run_commands(
pty: pty::Pty,
entry: async_std::sync::Arc<async_std::sync::Mutex<Entry>>,
mut env: ProcessEnv,
- close_w: async_std::channel::Sender<()>,
) {
async_std::task::spawn(async move {
for pipeline in ast.pipelines() {
@@ -583,7 +579,7 @@ fn run_commands(
}
entry.lock_arc().await.exit_info =
Some(ExitInfo::new(*env.latest_status()));
- close_w.send(()).await.unwrap();
+ pty.close().await;
});
}