docs: Quote PWD in window title example (#2539)
Quote expansion of $PWD to prevent word-splitting of its value, which gives an incorrect result if there is a single space and an error message if there is more than one space: ❯ basename /tmp/foo foo ❯ basename /tmp/foo bar foo ❯ basename /tmp/foo bar baz basename: extra operand ‘baz’ Try 'basename --help' for more information.
This commit is contained in:
parent
6bc2efd8bf
commit
7ef3caf542
|
@ -80,7 +80,7 @@ add the following snippet to your `~/.bashrc` or `~/.zshrc`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
function set_win_title(){
|
function set_win_title(){
|
||||||
echo -ne "\033]0; $(basename $PWD) \007"
|
echo -ne "\033]0; $(basename "$PWD") \007"
|
||||||
}
|
}
|
||||||
starship_precmd_user_func="set_win_title"
|
starship_precmd_user_func="set_win_title"
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue