X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=shell%2Fzsh%2Frc;h=515ae9bd30c64fb2704e65e87804e45eb429811f;hb=HEAD;hp=99e46af4cee67038b5aba1129637b555fca12e06;hpb=4feb6907a365f3dd19f246563c17656a7bc22f90;p=config%2Fdotfiles.git diff --git a/shell/zsh/rc b/shell/zsh/rc index 99e46af..515ae9b 100644 --- a/shell/zsh/rc +++ b/shell/zsh/rc @@ -228,6 +228,9 @@ local green="%{${fg[green]}%}" local yellow="%{${fg[yellow]}%}" local default="%{${fg[default]}%}" +# Linux network namespace +local netns="$(ip netns identify 2>/dev/null)" + # vcs_info was added in 4.3.9 but it works in earlier versions too. So load it # if the necessary files are available in ~/.zsh/functions/vcs_info (often a # symbolic link to current checkout of Zsh's sources). @@ -441,6 +444,10 @@ zshrc_prompt_precmd() { if [[ -n $SSH_CONNECTION ]]; then host="%U${host}%u" fi + # Linux network namespace if any + if [[ -n $netns ]]; then + host="${host}[$netns]" + fi # Number of background processes in yellow if not zero. local background="%(1j.${yellow}%j${default}.)" @@ -799,7 +806,6 @@ bindkey '^F' complete-files compdef slocate=locate compdef srsync=rsync compdef srsync-incremental=rsync -compdef svalgrind=valgrind compdef sc=systemctl @@ -856,7 +862,7 @@ alias -g S='| sort' alias -g SL='| sort | less' alias -g T='| tail' alias -g U='| uniq' -alias -g X='`xsel -p || xclip -o`' # X selection +alias -g X='-- "$(xsel -p || xclip -o)"' # X selection # Make going up directories simple. alias -g ...='../..'