From fdc5e802ebedb8b6563a1fce805d49a66113791e Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Fri, 17 May 2019 19:53:20 -0700 Subject: [PATCH] Update cwd as we cd --- src/commands/cd.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/commands/cd.rs b/src/commands/cd.rs index 399610b8a..78c9d053c 100644 --- a/src/commands/cd.rs +++ b/src/commands/cd.rs @@ -1,6 +1,7 @@ use crate::errors::ShellError; use crate::prelude::*; use derive_new::new; +use std::env; #[derive(new)] pub struct Cd; @@ -17,6 +18,7 @@ impl crate::Command for Cd { let mut stream = VecDeque::new(); let path = dunce::canonicalize(cwd.join(&target).as_path())?; + let _ = env::set_current_dir(&path); stream.push_back(ReturnValue::change_cwd(path)); Ok(stream) }