diff options
author | Jesse Luehrs <doy@tozt.net> | 2018-02-21 10:07:35 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2018-02-21 10:07:35 -0500 |
commit | fc1c92458045de8a6db408da29a7b8274fed931a (patch) | |
tree | 0ebf1e90db78246d58db1dcd32b51f4a1cba282e /src | |
parent | ec456a97d15b1b54fd6371d1c164d769b30e1b2f (diff) | |
download | fancy-prompt-fc1c92458045de8a6db408da29a7b8274fed931a.tar.gz fancy-prompt-fc1c92458045de8a6db408da29a7b8274fed931a.zip |
just always use $PWD
std::env::current_dir() canonicalizes symlinks (i think only the shell
itself keeps track of the path without doing that)
Diffstat (limited to 'src')
-rw-r--r-- | src/system_info.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/system_info.rs b/src/system_info.rs index d0f609b..8790cf4 100644 --- a/src/system_info.rs +++ b/src/system_info.rs @@ -21,13 +21,9 @@ pub fn terminal_cols() -> Option<usize> { } pub fn pwd() -> Option<std::path::PathBuf> { - std::env::current_dir() + std::env::var("PWD") + .map(|pwd| std::path::PathBuf::from(pwd)) .ok() - .or_else(|| { - std::env::var("PWD") - .map(|pwd| std::path::PathBuf::from(pwd)) - .ok() - }) } pub fn home() -> Option<std::path::PathBuf> { |