Fix _tide_pwd when the user's HOME contains spaces.

On my Windows system, for whatever reason, my `HOME` is `C:\Users\Alex Rønne Petersen` rather than the usual `C:\Users\alex` kind of thing you'd expect. (And yes, this has found a great many bugs in various pieces of software. 😄)

This would lead to more and more errors the deeper into a directory I went:

```
❯ cd /z
❯ cd Source
string replace: too many arguments
❯ cd tests
string replace: too many arguments
string replace: too many arguments
❯ cd cs
string replace: too many arguments
string replace: too many arguments
string replace: too many arguments
❯ cd bin
string replace: too many arguments
string replace: too many arguments
string replace: too many arguments
string replace: too many arguments
```

Quoting the use of `$HOME` here fixes the issue.
This commit is contained in:
Alex Rønne Petersen 2024-01-17 15:29:16 +01:00 committed by GitHub
parent fbca9587ae
commit ced735e8ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,7 +18,7 @@ eval "function _tide_pwd
string join / -- \$split_output | string length -V | read -g _tide_pwd_len
i=1 for dir_section in \$split_pwd[2..-2]
string join -- / \$split_pwd[..\$i] | string replace '~' $HOME | read -l parent_dir # Uses i before increment
string join -- / \$split_pwd[..\$i] | string replace '~' \"$HOME\" | read -l parent_dir # Uses i before increment
math \$i+1 | read i