Browse Source

Support quoting behavior of bash 4.3+

bash 4.2 will print literal tilde, which seems like least evil.
Alois Mahdal 10 years ago
parent
commit
cbf3a65fa8
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      dotfiles/bash/post.bashrc

+ 3
- 3
dotfiles/bash/post.bashrc View File

@@ -57,7 +57,7 @@ case "$TERM" in
57 57
     xterm*|rxvt*|screen*)
58 58
         test -n "$SSH_CONNECTION" \
59 59
          && __host_id="${HOSTNAME%%.*}:"      # i.e. a remote session
60
-        PROMPT_COMMAND='__save_rv $?; echo -ne "\033]0;$(__make_ps1d)$__host_id${PWD/$HOME/~}\$\007"'
60
+        PROMPT_COMMAND='__save_rv $?; echo -ne "\033]0;$(__make_ps1d)$__host_id${PWD/$HOME/\~}\$\007"'
61 61
 
62 62
         # Show the currently running command in the terminal title:
63 63
         # http://www.davidpashley.com/articles/xterm-titles-with-bash.html
@@ -71,10 +71,10 @@ case "$TERM" in
71 71
                     # output them.
72 72
                     ;;
73 73
                 "")
74
-                    echo -ne "\033]0;$(__make_ps1d)$__host_id${PWD/$HOME/~}\$\007"
74
+                    echo -ne "\033]0;$(__make_ps1d)$__host_id${PWD/$HOME/\~}\$\007"
75 75
                     ;;
76 76
                 *)
77
-                    echo -ne "\033]0;${BASH_COMMAND} ($__host_id${PWD/$HOME/~})\007"
77
+                    echo -ne "\033]0;${BASH_COMMAND} ($__host_id${PWD/$HOME/\~})\007"
78 78
                     ;;
79 79
             esac
80 80
         }