From 7ef3caf542c82c362a532ac46cb0e680cbc63347 Mon Sep 17 00:00:00 2001 From: Tom Most Date: Thu, 1 Apr 2021 21:17:22 -0700 Subject: [PATCH] docs: Quote PWD in window title example (#2539) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- docs/advanced-config/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced-config/README.md b/docs/advanced-config/README.md index ed6bb7c0..061a3233 100644 --- a/docs/advanced-config/README.md +++ b/docs/advanced-config/README.md @@ -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" ```