aboutsummaryrefslogtreecommitdiff
path: root/src/prompt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/prompt.rs')
-rw-r--r--src/prompt.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/prompt.rs b/src/prompt.rs
index e70c958..12df7e0 100644
--- a/src/prompt.rs
+++ b/src/prompt.rs
@@ -27,7 +27,8 @@ impl Prompt {
Ok(Prompt { ps1, home })
}
- pub fn print(&self, pwd: &std::path::PathBuf) -> std::string::String {
+ pub fn print(&self) -> std::string::String {
+ let pwd = std::env::current_dir().unwrap();
let path = if pwd.starts_with(&self.home) {
"~".to_owned() + &pwd.strip_prefix(&self.home).unwrap().display().to_string()
} else {