diff --git a/roles/home-cli/files/shrc b/roles/home-cli/files/shrc index b081145..c8469e5 100644 --- a/roles/home-cli/files/shrc +++ b/roles/home-cli/files/shrc @@ -1,7 +1,7 @@ #!/bin/sh export ACP_SHRC=1 -if [ "$ZSH_VERSION" ]; then +if [ "${ZSH_VERSION-none}" != "none" ]; then emulate sh -c 'source /etc/profile' fi @@ -128,19 +128,19 @@ export POWERSHELL_TELEMETRY_OPTOUT=1 export PYTHONWARNINGS="ignore::UserWarning" PS1="$ " -if test -z "${HOST}"; then +if [ "${HOST-invalid}" != "invalid" ]; then HOST="$(hostname 2>/dev/null || cat /etc/hostname)" fi if test $(id -u) -eq 0; then - export PS1="${HOST%%.*}# " + export PS1="${HOST-localhost%%.*}# " else - export PS1="${HOST%%.*}$ " + export PS1="${HOST-localhost%%.*}$ " fi if test -x /usr/bin/tty; then export GPG_TTY=$(tty) fi -if [ "$BASH" ]; then +if [ "${BASH-none}" != "none" ]; then HISTCONTROL=ignorespace:ignoredups shopt -s histappend bind '"\e[1;5C": forward-word' @@ -157,7 +157,7 @@ if [ "$BASH" ]; then fi fi -if [ "$ZSH_VERSION" ]; then +if [ "${ZSH_VERSION-none}" != "none" ]; then # Command history. autoload -Uz compinit && compinit autoload -U history-search-end