summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojciech Kępka2021-09-02 02:03:42 +0000
committerGitHub2021-09-02 02:03:42 +0000
commit7e1123680f474bff5113db189f63ca7f948781a5 (patch)
treef859b9447662a4f19a8cf63510eabc7d0f06fb1d
parent5766f5da8fc9e98320e7e765c47e701d72108028 (diff)
Expand `~` in `change-current-directory` command (#692)
-rw-r--r--helix-term/src/commands.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 3bd63ab4..116f39bd 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1838,7 +1838,11 @@ mod cmd {
args: &[&str],
_event: PromptEvent,
) -> anyhow::Result<()> {
- let dir = args.first().context("target directory not provided")?;
+ let dir = helix_core::path::expand_tilde(
+ args.first()
+ .context("target directory not provided")?
+ .as_ref(),
+ );
if let Err(e) = std::env::set_current_dir(dir) {
bail!("Couldn't change the current working directory: {}", e);