Commit 2af4d8fa authored by Pierre-antoine Comby's avatar Pierre-antoine Comby
Browse files

[bashrc] prompt show screen session name

parent 168d3356
......@@ -449,6 +449,11 @@ function prompt_command
else
VENV=''
fi
if [[ ${STY} != "" ]]
then
SCREEN_NAME=${STY//[[:digit:]]/}
SCREEN_ENV="[${SCREEN_NAME#.}]"
fi
# Génération des différents morceaux du prompt, avec ou sans la couleur
if [ "$color_prompt" = yes ]; then
......@@ -462,7 +467,7 @@ function prompt_command
DATE="( ${date_color}\D{%H:%M:%S}${line_color_prompt} )"
# Deuxième ligne du prompt "user@host $"
# Attention "\\\$" devient \$, c'est-à-dire # pour root, $ pour les autres
PROMPT="${username_color}\u${symbols_color}@${host_color}\h ${symbols_color}${VENV}${symbols_color}\\\$ ${nocolor_prompt}"
PROMPT="${username_color}\u${symbols_color}@${host_color}\h ${symbols_color}${SCREEN_ENV}${VENV}${symbols_color}\\\$ ${nocolor_prompt}"
# On fusionne tout ça
PS1=$TITLE${line_color_prompt}$MINUS_CHAR$DATE$MINUS_CHAR$DIR$MINUS_CHAR${line_color_prompt}$POST_DIR$VCS_info$ERR'\n'$PROMPT
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment