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:
Tom Most 2021-04-01 21:17:22 -07:00 committed by GitHub
parent 6bc2efd8bf
commit 7ef3caf542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ add the following snippet to your `~/.bashrc` or `~/.zshrc`:
```bash
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"
```