container aware prompt
This commit is contained in:
+6
-4
@@ -25,6 +25,10 @@ function __miaou_prompt_command {
|
||||
PS1=''
|
||||
IFS=' '
|
||||
|
||||
if [[ -v HOST_TYPE && -v HOST_LOCATION ]]; then
|
||||
PS1+="\[\e[44;30m\]${HOST_TYPE}://${HOST_LOCATION}\[\e[49;34m\]${R} "
|
||||
fi
|
||||
|
||||
if [[ "$UID" -eq 0 ]]; then
|
||||
PS1+="$Yel\u$R"
|
||||
PROMPT='$'
|
||||
@@ -95,20 +99,18 @@ function __miaou_prompt_command {
|
||||
# If not running interactively, don't do anything
|
||||
[[ $- != *i* ]] && return
|
||||
|
||||
# TODO: use /etc/environment for MIAOU_BASH_DIR and leave /etc/profile to reset PROMPT_AFTER after tilix/cve
|
||||
if [[ ! -v MIAOU_BASH_DIR ]]; then
|
||||
source /etc/profile.d/zz-miaou-bash.sh
|
||||
else
|
||||
PROMPT_COMMAND=__miaou_prompt_command
|
||||
fi
|
||||
|
||||
export BLOCK_SIZE=si
|
||||
HOSTNAME=$(hostname -f)
|
||||
HISTCONTROL=ignoreboth
|
||||
HISTSIZE=10000
|
||||
HISTFILESIZE=20000
|
||||
BLOCK_SIZE=si
|
||||
export BLOCK_SIZE
|
||||
|
||||
export BLOCK_SIZE=si
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
Reference in New Issue
Block a user