ソースを参照

Only print username on a remote (assume SSH) sessions

Alois Mahdal 11 年 前
コミット
f419b456ca
共有1 個のファイルを変更した1 個の追加1 個の削除を含む
  1. 1
    1
      dotfiles/bash/post.bashrc

+ 1
- 1
dotfiles/bash/post.bashrc ファイルの表示

30
 make_ps1() {
30
 make_ps1() {
31
     # these functions must be already defined by ~/.bash/user/*.bashrc
31
     # these functions must be already defined by ~/.bash/user/*.bashrc
32
     # and ~/.bash/host/*.bashrc
32
     # and ~/.bash/host/*.bashrc
33
-    local ps1u=$(make_ps1u)
33
+    test -n "$SSH_CONNECTION" && local ps1u=$(make_ps1u)
34
     local ps1h=$(make_ps1h)
34
     local ps1h=$(make_ps1h)
35
     local ps1w="$lblue\w$normal";
35
     local ps1w="$lblue\w$normal";
36
     local ps1G='$(__git_ps1 "(%s)")';
36
     local ps1G='$(__git_ps1 "(%s)")';