Skip to content

Commit

Permalink
Expand ~ in change-current-directory command (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
vv9k authored Sep 2, 2021
1 parent 5766f5d commit 7e11236
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7e11236

Please sign in to comment.