mirror of
https://github.com/IlanCosman/tide.git
synced 2024-09-11 09:05:37 +03:00
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:
parent
fbca9587ae
commit
ced735e8ba
@ -18,7 +18,7 @@ eval "function _tide_pwd
|
|||||||
string join / -- \$split_output | string length -V | read -g _tide_pwd_len
|
string join / -- \$split_output | string length -V | read -g _tide_pwd_len
|
||||||
|
|
||||||
i=1 for dir_section in \$split_pwd[2..-2]
|
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
|
math \$i+1 | read i
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user