summaryrefslogtreecommitdiffstats
path: root/src/shell/mod.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-15 01:20:43 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-15 01:21:33 -0500
commit3adc8b67354a492f4bceed4b9bf1ec5c000c2056 (patch)
tree33b6e041c8b1e1962592b1ce8c7a5b36c4ab1d8e /src/shell/mod.rs
parent35a7db590aab2c8d1508115a490678fce6376000 (diff)
downloadnbsh-3adc8b67354a492f4bceed4b9bf1ec5c000c2056.tar.gz
nbsh-3adc8b67354a492f4bceed4b9bf1ec5c000c2056.zip
set default SHELL and TERM for subprocesses
Diffstat (limited to 'src/shell/mod.rs')
-rw-r--r--src/shell/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/shell/mod.rs b/src/shell/mod.rs
index e7160be..0547bae 100644
--- a/src/shell/mod.rs
+++ b/src/shell/mod.rs
@@ -146,7 +146,7 @@ pub async fn main() -> anyhow::Result<i32> {
});
}
- let mut shell = Shell::new(crate::info::get_offset());
+ let mut shell = Shell::new(crate::info::get_offset())?;
let mut prev_dir = shell.env.current_dir().to_path_buf();
git_w.send(prev_dir.clone()).await.unwrap();
let event_reader = event::Reader::new(event_r);
@@ -211,18 +211,18 @@ pub struct Shell {
}
impl Shell {
- pub fn new(offset: time::UtcOffset) -> Self {
- Self {
+ pub fn new(offset: time::UtcOffset) -> anyhow::Result<Self> {
+ Ok(Self {
readline: readline::Readline::new(),
history: history::History::new(),
- env: Env::new(),
+ env: Env::new()?,
git: None,
focus: Focus::Readline,
scene: Scene::Readline,
escape: false,
hide_readline: false,
offset,
- }
+ })
}
pub async fn render(