diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-01-08 11:01:20 -0500 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-01-08 11:01:20 -0500 |
commit | c81ad2007707272c357cdc46186e89cf89d43965 (patch) | |
tree | 7b71d1ae63752aac8b1d33050cd71a43e069a01b | |
parent | 8506ff208fc988a2b8f08a9a28a36c80362aa0be (diff) |
fix change directory not actually changing directory
-rw-r--r-- | src/joshuto/command/change_directory.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/joshuto/command/change_directory.rs b/src/joshuto/command/change_directory.rs index 1ab787b..8f58f28 100644 --- a/src/joshuto/command/change_directory.rs +++ b/src/joshuto/command/change_directory.rs @@ -43,7 +43,16 @@ impl command::Runnable for ChangeDirectory { return; } - context.curr_path = self.path.clone(); + + match std::env::set_current_dir(self.path.as_path()) { + Ok(_) => { + context.curr_path = self.path.clone(); + }, + Err(e) => { + ui::wprint_err(&context.views.bot_win, e.to_string().as_str()); + return; + } + } { context.history.populate_to_root(&context.curr_path, &context.config_t.sort_type); |