-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
36 lines (29 loc) · 1.15 KB
/
Copy path.bashrc
File metadata and controls
36 lines (29 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
################################################################################
# Shell Options
################################################################################
shopt -s histappend
shopt -s checkwinsize
shopt -s expand_aliases
################################################################################
# Prompt
################################################################################
WHITE=$(echo -e "\[\e[38;5;7m\]")
BLUE=$(echo -e "\[\e[38;5;45m\]")
GREEN=$(echo -e "\[\e[38;5;46m\]")
RED=$(echo -e "\[\e[38;5;204m\]")
# Print return code if not 0
__prompt_command()
{
EXIT=$?
[[ ${EXIT} != 0 ]] && echo -e "${R}[ Return code : ${EXIT} ]${W}"
}
export PS1="${RED}\u${WHITE}@${GREEN}\h ${WHITE}\W${BLUE}\$(__git_ps1) $ ${WHITE}"
export PS2="${BLUE}>${WHITE} "
export PS4="${BLUE}Line ${LINENO} >${WHITE} "
export PROMPT_COMMAND=__prompt_command
################################################################################
# Load common shell configuration
################################################################################
# shellcheck disable=SC1091
[[ -f "${HOME}"/.shellrc ]] && . "${HOME}"/.shellrc