on master help sign in
Expand `~` in `change-current-directory` command (#692)
7e11236Wojciech Kępka
helix-term/src/commands.rs+5−1
@@ -1838,7 +1838,11 @@ mod cmd {
1838 args: &[&str],
1838 args: &[&str],
1839 _event: PromptEvent,
1839 _event: PromptEvent,
1840 ) -> anyhow::Result<()> {
1840 ) -> anyhow::Result<()> {
1841+ let dir = helix_core::path::expand_tilde(
1842+ args.first()
1841− let dir = args.first().context("target directory not provided")?;
1843+ .context("target directory not provided")?
1844+ .as_ref(),
1845+ );
1842
1846
1843 if let Err(e) = std::env::set_current_dir(dir) {
1847 if let Err(e) = std::env::set_current_dir(dir) {
1844 bail!("Couldn't change the current working directory: {}", e);
1848 bail!("Couldn't change the current working directory: {}", e);