X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=blobdiff_plain;f=shell%2Fzsh%2Frc;fp=shell%2Fzsh%2Frc;h=515ae9bd30c64fb2704e65e87804e45eb429811f;hp=660430cc3789504c5433c4da0969c8927166a5c8;hb=b267e9357b46a728d62be0627a7f96b2d8cd9061;hpb=e5f0ee9f7010477adac5b4379537e38a65949a13 diff --git a/shell/zsh/rc b/shell/zsh/rc index 660430c..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}.)"