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

View File

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