{bash,zsh}rc: add a newline before each command

To workaround silly files that don't end with a newline
This commit is contained in:
Aminda Suomalainen 2024-05-29 07:39:46 +03:00
parent ef1fb81709
commit bf37d602a8
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 11 additions and 4 deletions

View File

@ -62,18 +62,18 @@ if [ -n "$force_color_prompt" ]; then
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS1='\n${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS1='\n${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# Red colour for root, thanks nyuszika7h
# Check if we're root
if [[ $EUID == 0 ]]; then
PS1='\033[1;31m\u@\h:\w\$\033[0m '
PS1='\n\033[1;31m\u@\h:\w\$\033[0m '
else
PS1='\033[1;32m\u@\h:\w\$\033[0m '
PS1='\n\033[1;32m\u@\h:\w\$\033[0m '
fi
# If this is an xterm set the title to user@host:dir

View File

@ -59,6 +59,13 @@ else
prompt elite2 green
fi
# Newline before new prompt
precmd() {
precmd() {
printf "\n"
}
}
# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e