Skip to content

Commit

Permalink
docs: Quote PWD in window title example (starship#2539)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
twm authored Apr 2, 2021
1 parent 6bc2efd commit 7ef3caf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/advanced-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
Expand Down

0 comments on commit 7ef3caf

Please sign in to comment.