mirror of https://github.com/helix-editor/helix
Expand `~` in `change-current-directory` command (#692)
parent
5766f5da8f
commit
7e1123680f
|
@ -1838,7 +1838,11 @@ mod cmd {
|
||||||
args: &[&str],
|
args: &[&str],
|
||||||
_event: PromptEvent,
|
_event: PromptEvent,
|
||||||
) -> anyhow::Result<()> {
|
) -> 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) {
|
if let Err(e) = std::env::set_current_dir(dir) {
|
||||||
bail!("Couldn't change the current working directory: {}", e);
|
bail!("Couldn't change the current working directory: {}", e);
|
||||||
|
|
Loading…
Reference in New Issue