diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2025-10-04 22:02:18 +0200 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2025-10-04 22:21:49 +0200 |
| commit | 4a614abd000a08a176007cd661a69b16038deed7 (patch) | |
| tree | a950874693203d10c733a9eb808fd5e92af79f7c | |
| parent | 6313738906f760f8a9b73cfe18dc2593bee1b4c5 (diff) | |
| download | dotfiles-4a614abd000a08a176007cd661a69b16038deed7.tar.xz | |
Stop special-casing Git repos in console window titles
The prefixes that all this code shaves are fairly small, all things
considered. Not sure this code carries its own weight.
| -rw-r--r-- | .bash_prompt | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/.bash_prompt b/.bash_prompt index 97297d4..e3c9a87 100644 --- a/.bash_prompt +++ b/.bash_prompt @@ -33,23 +33,7 @@ __set-title () title+="@${HOSTNAME}" fi title+=: - - local path=${PWD/~/\~} - local git_root=$(git rev-parse --show-toplevel 2> /dev/null) - - if [ -z "${git_root}" -o "${git_root}" = ~ ] - then - title+=${path} - else - local project=$(basename "${git_root}") - path=$(realpath --relative-to "${git_root}" "${PWD}") - if [ "${path}" = . ] - then - title+=${project} - else - title+=${project}/${path} - fi - fi + title+=${PWD/~/\~} # Cf. console_codes(4): # |
