-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathterminal-line-separator
96 lines (48 loc) · 2.19 KB
/
terminal-line-separator
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
############################################
# This is a custom bash_profile which adds a Vulcan prompt and creates a clocked separator between executed commands
# Vulcan Emoji requires OS X 10.10.3 or later to render properly, if you're on a prior version you can comment that out
# Modified by Paul @ OSXDaily.com for a Spock Vulcan LLAP prompt + minor changes
# Originally modified for Mac OS X by @corndogcomputer based on emilis script
# from https://github.com/emilis/emilis-config/blob/master/.bash_ps1
###########################################
# Fill with underscore ___ or minuses ---
# (this is recalculated every time the prompt is shown in function prompt_command):
fill="___ "
reset_style='\[\033[00m\]'
status_style=$reset_style'\[\033[0;90m\]' # gray color; use 0;37m for lighter color
prompt_style=$reset_style
command_style=$reset_style'\[\033[1;29m\]' # bold black
# Prompt variable:
# Defaulting to Spock Live Long And Prosper prompt
PS1="$status_style"'$fill \t\n'"$prompt_style"'${debian_chroot:+($debian_chroot)}\u@\h:\w\🖖 $'"$command_style "
# Optional but not really optional Vulcan salute unicode: U+1F596 🖖
# Modify bash prompt with other variables as desired:
# http://osxdaily.com/2006/12/11/how-to-customize-your-terminal-prompt/
# For those who don't want Spock LLAP or are not running mdoern OS X, use the following:
#PS1="$status_style"'$fill \t\n'"$prompt_style"'${debian_chroot:+($debian_chroot)}\u@\h:\w\ $'"$command_style "
# Reset color for command output
# (this one is invoked every time before a command is executed):
trap 'echo -ne "\033[00m"' DEBUG
function prompt_command {
# create a $fill of all screen width minus the time string and a space:
let fillsize=${COLUMNS}-9
fill=""
while [ "$fillsize" -gt "0" ]
do
fill="-${fill}" # fill with underscores to work on
let fillsize=${fillsize}-1
done
# If this is an xterm set the title to user@host:dir
# If you don't want to change the title, comment out this block
case "$TERM" in
xterm*|rxvt*)
bname=`basename "${PWD/$HOME/~}"`
echo -ne "\033]0;${bname}: ${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"
;;
*)
;;
esac
}
PROMPT_COMMAND=prompt_command
# default ls to color -G flag
alias ls='ls -G'