Repository navigation
Closed
Description
Describe the bug
When I try to cd out of my directory to a directory from HOME using the tilda (~) symbol, for example cd ~\Documents\ , I get the error error: Cannot change to directory. To get around it I do cd ~ then cd Documents\ but this is quite annoying. Also when I do this starship starts displaying weird (not properly showing the current dir) but that might be something to do with starship.
To Reproduce
Steps to reproduce the behavior:
cdto a directory- Change our of that directory with tilda like
cd ~\Documents\ - returns "error: Cannot change to directory"
Expected behavior
To change directory to ~\Documents\
Configuration (please complete the following information):
Run version | pivot and paste the output to show OS, features, etc.
> version | pivot
╭───┬────────────────────┬───────────────────────────────────────────────────────────────────────╮
│ # │ Column0 │ Column1 │
├───┼────────────────────┼───────────────────────────────────────────────────────────────────────┤
│ 0 │ version │ 0.27.1 │
│ 1 │ build_os │ windows-x86_64 │
│ 2 │ rust_version │ rustc 1.50.0 │
│ 3 │ cargo_version │ cargo 1.50.0 │
│ 4 │ pkg_version │ 0.27.1 │
│ 5 │ build_time │ 2021-03-07 22:01:06 │
│ 6 │ build_rust_channel │ release │
│ 7 │ features │ ctrlc, default, directories, dirs, git, ichwh, ptree, │
│ │ │ rustyline, term, uuid, which, zip │
╰───┴────────────────────┴───────────────────────────────────────────────────────────────────────╯
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
No labels

Activity
sophiajt commentedon Mar 8, 2021
@MozarellaMan - does doing
cd ~/Documents/work? I'm wondering if it's a bug in how we expand the path on WindowsMozarellaMan commentedon Mar 8, 2021
Yes! That does work. Still that weird issue with the directory display on starship not updating till I enter another command to confirm. Again could be a starship issue, but this is the only situation I've seen it happen. Also, yeah, using forward slash breaks autocomplete for me ( #2535 )
kubouch commentedon Mar 8, 2021
There is a couple of cases of inconsistent path handling and weird issues like this one. I believe this particular issue comes from the dependency
shellexpandwhich doesn't support tilde expansion on Windows paths. This is something I wanted to look at more closely with my next PR and hopefully fix these subtle errors.fdncred commentedon Mar 27, 2021
I'm pretty sure I fixed this with #3210. Please re-open this if I did not.