summaryrefslogtreecommitdiffstats
path: root/src/shell/history/mod.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-05 07:30:34 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-05 07:30:34 -0500
commitf9c5cb86304748baf0da99126bf75c5a3cd3e773 (patch)
tree7583e15d3e6b82db02b3815516309fc4bb4ebfb3 /src/shell/history/mod.rs
parenta30174620d6b64f838989a634c265a353b2ab117 (diff)
downloadnbsh-f9c5cb86304748baf0da99126bf75c5a3cd3e773.tar.gz
nbsh-f9c5cb86304748baf0da99126bf75c5a3cd3e773.zip
and more simplification
Diffstat (limited to 'src/shell/history/mod.rs')
-rw-r--r--src/shell/history/mod.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/shell/history/mod.rs b/src/shell/history/mod.rs
index 76e7d3b..d8adb49 100644
--- a/src/shell/history/mod.rs
+++ b/src/shell/history/mod.rs
@@ -1,10 +1,5 @@
use crate::shell::prelude::*;
-use async_std::io::WriteExt as _;
-use futures_lite::future::FutureExt as _;
-use std::os::unix::io::{FromRawFd as _, IntoRawFd as _};
-use std::os::unix::process::ExitStatusExt as _;
-
mod entry;
pub use entry::Entry;
mod pty;
@@ -93,7 +88,7 @@ impl History {
pub async fn run(
&mut self,
ast: crate::parse::Commands,
- env: &crate::Env,
+ env: &Env,
event_w: async_std::channel::Sender<Event>,
) -> anyhow::Result<usize> {
let (input_w, input_r) = async_std::channel::unbounded();
@@ -124,7 +119,7 @@ impl History {
pub async fn parse_error(
&mut self,
e: crate::parse::Error,
- env: &crate::Env,
+ env: &Env,
event_w: async_std::channel::Sender<Event>,
) -> anyhow::Result<usize> {
// XXX would be great to not have to do this
@@ -274,7 +269,7 @@ impl std::iter::DoubleEndedIterator for VisibleEntries {
fn run_commands(
ast: crate::parse::Commands,
entry: async_std::sync::Arc<async_std::sync::Mutex<Entry>>,
- mut env: crate::Env,
+ mut env: Env,
input_r: async_std::channel::Receiver<Vec<u8>>,
resize_r: async_std::channel::Receiver<(u16, u16)>,
event_w: async_std::channel::Sender<Event>,
@@ -330,7 +325,7 @@ fn run_commands(
async fn run_pipeline(
pty: &pty::Pty,
- env: &mut crate::Env,
+ env: &mut Env,
event_w: async_std::channel::Sender<Event>,
) -> anyhow::Result<(async_std::process::ExitStatus, bool)> {
let mut cmd = pty_process::Command::new(std::env::current_exe().unwrap());