# send xterm scrollback clear extension just in case:
# - TERM may not be set correctly
# - terminfo/termcap database entry for reset may be buggy
- echo -n '\e[3J'
+ echo -en '\e[3J'
# use terminfo/termcap directly instead of relying on system clear/reset:
# - often they are just wrappers for ncurses tput or other tools
# - they may not even exist on lightweight systems
}
if (( y == 0 )) {
# fallback, send ECMA-48 clear
- echo -n '\e[2J'
+ echo -en '\e[2J'
}
echo logout
}
# clunky (e.g. asking for password twice) to make it worth it.
function _gpg_socketpath {
# dirs are percent-encoded: https://stackoverflow.com/a/64312099
- echo ${1//(#b)%([[:xdigit:]](#c2))/${(#):-0x$match[1]}}
+ echo -E - ${1//(#b)%([[:xdigit:]](#c2))/${(#):-0x$match[1]}}
}
if [[ ! -v _sev_setup_gpg_forward && -v commands[gpg] ]] {
# XXX: assuming /tmp exists and is writable on destination
} else {
eval $(eval $=c) >/dev/null 2>&1
}
- echo -n $SSH_AUTH_SOCK$'\0'$SSH_AGENT_PID >!$e
+ echo -En - $SSH_AUTH_SOCK$'\0'$SSH_AGENT_PID >!$e
unset c
fi
unset okc e sock pid
[[ -v _sev_home ]] || export _sev_home=$HOME
## fix broken term
-# NOTE: we do this here instead of .zshrc since we might echo stuff
+# NOTE: we do this here instead of .zshrc since we might print stuff
if [[ -t 1 ]] { # only if stdout is tty
[[ ! -v TERM ]] && export TERM=xterm-256color >/dev/null 2>&1
if [[ $#terminfo -eq 0 ]] {
if [[ -n $keymap ]] {
source $keymap
} else {
- echo "Failed to source keymap file $keymap" >&2
+ echo -E "Failed to source keymap file $keymap" >&2
}
unfunction find_keymap; unset keymap
}
}
alias cd..=up
## dotfiles
-alias dfu='d=${$(echo ~/.zshenv):P:h:h};GIT_DIR=$d/.git GIT_WORK_TREE=$d git pull'
+alias dfu='d=${$(echo -E - ~/.zshenv):P:h:h};GIT_DIR=$d/.git GIT_WORK_TREE=$d git pull'
### hooks
autoload -Uz add-zsh-hook
function vol {
if [[ -z "$1" ]] {
for x in $(mixerctl -a | grep 'outputs\.master'); do
- echo $x
+ echo -E - $x
done
return
}
PROMPT="%F{$c}>>> $hist"
;;
*)
- echo "Unknown prompt mode $m"
+ echo -E "Unknown prompt mode $m"
return
;;
}