container aware prompt

This commit is contained in:
pvincent
2026-09-07 13:25:59 +04:00
parent 16a9dace7c
commit 21fbb0ed00
3 changed files with 14 additions and 11 deletions
+6 -4
View File
@@ -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