logo

dotfiles

My dotfiles, one branch per machine, rebased on base git clone https://hacktivis.me/git/dotfiles.git
commit: 2f6ff29dbafc1450c340f57f8d89af1fa12aeb11
parent 301aa198c054ed699ed382967b9eaddbcaa56619
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 21 Jun 2024 22:07:59 +0200

.common.sh: Don't export PS1/…/PS4 variables

Diffstat:

M.common.sh8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/.common.sh b/.common.sh @@ -84,17 +84,19 @@ jobs_pp() { fi } +# Note: PS1/…/PS4 variables are shell specific and therefore shouldn't be exported +PS4='$ ' case $SHELL in *ksh*) # hack derived from ksh88(1), works in mksh, doesn't works in bash - export PS1='$(jobs_pp)$?$(date +w%wT%T)${USER}[${host_ansi}m@$(hostname)$(get_working_directory)$(get_git_branch) ' + PS1='$(jobs_pp)$?$(date +w%wT%T)${USER}[${host_ansi}m@$(hostname)$(get_working_directory)$(get_git_branch) ' ;; *bash*) - export PS1='\[\e[47;30m\]$(jobs_pp)$?\[\e[37;100m\]\[\e[100;30m\]$(date +w%wT%T)\[\e[40;90m\]\[\e[40;32m\]\u\[\e[${host_ansi}m\]@\h\]\[\e[30;46m\]$(get_working_directory)\[\e[0;36m\]\[\e[0m\] ' + PS1='\[\e[47;30m\]$(jobs_pp)$?\[\e[37;100m\]\[\e[100;30m\]$(date +w%wT%T)\[\e[40;90m\]\[\e[40;32m\]\u\[\e[${host_ansi}m\]@\h\]\[\e[30;46m\]$(get_working_directory)\[\e[0;36m\]\[\e[0m\] ' ;; *) # Don't even try escape codes, and so no powerline-style - export PS1='$? $(date +w%wT%T) $USER@${HOSTNAME:=$(hostname)} $(get_working_directory) > ' + PS1='$? $(date +w%wT%T) $USER@${HOSTNAME:=$(hostname)} $(get_working_directory) > ' ;; esac