sh_shell
This commit is contained in:
parent
8fae0bd63e
commit
07483cdadf
1 changed files with 5 additions and 4 deletions
9
sh/sh.sh
9
sh/sh.sh
|
@ -1,11 +1,12 @@
|
||||||
PS1="\$(shell_prompt \${?})"
|
PS1="\$(shell_prompt \${?})"
|
||||||
PS2="\
|
PS2="\
|
||||||
├ "
|
├ "
|
||||||
SH="$(cat /proc/$$/comm)"
|
|
||||||
|
SH_SHELL="$(cat /proc/$$/comm)"
|
||||||
|
|
||||||
shell_color() {
|
shell_color() {
|
||||||
local code="${1}"
|
local code="${1}"
|
||||||
case "${SH}" in
|
case "${SH_SHELL}" in
|
||||||
"bash")
|
"bash")
|
||||||
printf "\x01\e[0"
|
printf "\x01\e[0"
|
||||||
if [ -n "${code}" ]; then
|
if [ -n "${code}" ]; then
|
||||||
|
@ -32,7 +33,7 @@ SH_MAGENTA="$(shell_color 35)"
|
||||||
SH_RED="$(shell_color 32)"
|
SH_RED="$(shell_color 32)"
|
||||||
|
|
||||||
shell_configure() {
|
shell_configure() {
|
||||||
case "${SH}" in
|
case "${SH_SHELL}" in
|
||||||
"bash")
|
"bash")
|
||||||
# completion
|
# completion
|
||||||
local root="/usr/share/bash-completion"
|
local root="/usr/share/bash-completion"
|
||||||
|
@ -140,7 +141,7 @@ x() {
|
||||||
"${@}"
|
"${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
[ "${SH}" = "bash" ] || return
|
[ "${SH_SHELL}" = "bash" ] || return
|
||||||
|
|
||||||
# shellcheck disable=SC3033
|
# shellcheck disable=SC3033
|
||||||
..() {
|
..() {
|
||||||
|
|
Loading…
Reference in a new issue