From a5d8f0f7fb92b04b2532a5c0daf514a7ff7e0d4c Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Mon, 12 Sep 2022 08:00:18 +0100 Subject: [PATCH] Remove prompt examples I'll never use. --- .bashrc | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.bashrc b/.bashrc index 84f3f54..d41b3fa 100644 --- a/.bashrc +++ b/.bashrc @@ -150,6 +150,8 @@ __write_ssh_agents() { } __ssh_agent_prompt_command() { + # Returns: 0 = All is good. + # 1 = And error occured. local ERR SSH_AUTH_SOCKS=() if [[ -z "$SSH_AUTH_SOCK" ]]; then @@ -221,30 +223,16 @@ if (( BASH_VERSINFO[0] >= 4 )); then # Set the prompts. PROMPT_DIRTRIM=2 - # No colour: - # PS1="[\u@\h] \w ->" - # Coloured username: - # PS1="[\[$(tput bold)$(tput setaf $COLOUR)\]\u\[$(tput sgr0)\]@\h] \w ->" - # Coloured username + host: - # PS1="[\[$(tput bold)$(tput setaf $COLOUR)\]\u\[$(tput sgr0)\]@\[$(tput bold)$(tput setaf 3)\]\h\[$(tput sgr0)\]] \w ->" # Coloured username + host + directory: PS1="[\[$(tput bold)$(tput setaf $COLOUR)\]\u\[$(tput sgr0)\]@\[$(tput bold)$(tput setaf 3)\]\h\[$(tput sgr0)\]] \[$(tput bold)$(tput setaf 4)\]\w\[$(tput sgr0)\] ->" else # Set the prompts. - # No colour: - # PS1="[\u@\h] \$(echo \"\${PWD/#\$HOME/~}\" | awk -F/ '{if (NF>3) {printf \".../\" \$(NF-1) \"/\" \$NF} else {printf \$0}}') ->" - # Coloured username: - # PS1="[\[$(tput bold)$(tput setaf $COLOUR)\]\u\[$(tput sgr0)\]@\h] \$(echo \"\${PWD/#\$HOME/~}\" | awk -F/ '{if (NF>3) {printf \".../\" \$(NF-1) \"/\" \$NF} else {printf \$0}}') ->" - # Coloured username + host: - # PS1="[\[$(tput bold)$(tput setaf $COLOUR)\]\u\[$(tput sgr0)\]@\[$(tput bold)$(tput setaf 3)\]\h\[$(tput sgr0)\]] \$(echo \"\${PWD/#\$HOME/~}\" | awk -F/ '{if (NF>3) {printf \".../\" \$(NF-1) \"/\" \$NF} else {printf \$0}}') ->" # Coloured username + host + directory: PS1="[\[$(tput bold)$(tput setaf $COLOUR)\]\u\[$(tput sgr0)\]@\[$(tput bold)$(tput setaf 3)\]\h\[$(tput sgr0)\]] \[$(tput bold)$(tput setaf 4)\]\$(echo \"\${PWD/#\$HOME/~}\" | awk -F/ '{if (NF>3) {printf \".../\" \$(NF-1) \"/\" \$NF} else {printf \$0}}')\[$(tput sgr0)\] ->" fi unset COLOUR # Set the debugger prompt. -# PS4="+(\\\$? = \$?) \${BASH_SOURCE##*/}\${FUNCNAME[0]:+(\${FUNCNAME[0]})}:\$LINENO: " -# PS4="+(\[\e[1;33;40m\]\\\$? = \$?\[$(tput sgr0)\]) \[$(tput bold)$(tput setaf 4)\]\${BASH_SOURCE##*/}\[$(tput sgr0)\]\${FUNCNAME[0]:+(\[$(tput bold)$(tput setaf 2)\]\${FUNCNAME[0]}\[$(tput sgr0)\])}:\[$(tput bold)$(tput setaf 1)\]\$LINENO\[$(tput sgr0)\]: " export PS4="+(\[\e[1;33;40m\]\$?\[$(tput sgr0)\]) \[$(tput bold)$(tput setaf 4)\]\${BASH_SOURCE##*/}\[$(tput sgr0)\]\${FUNCNAME[0]:+(\[$(tput bold)$(tput setaf 2)\]\${FUNCNAME[0]}\[$(tput sgr0)\])}:\[$(tput bold)$(tput setaf 1)\]\$LINENO\[$(tput sgr0)\]: " # The commands to execute before the prompt is displayed.