zshrc: Remove vterm, add SSH/ gpg tweaks

pull/1/head
earnest ma 2021-12-27 15:51:55 +00:00
parent 448a85d588
commit 73a76e7586
Signed by: earnest ma
GPG Key ID: A343F43342EB6E2A
1 changed files with 3 additions and 29 deletions

View File

@ -63,36 +63,10 @@ zreload() {
[[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh [[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh
} }
# Emacs/ vterm # w/ SSH
vterm_printf(){ if [[ "$HOST" == core.envs.net ]]; then
if [ -n "$TMUX" ] && ([ "${TERM%%-*}" = "tmux" ] || [ "${TERM%%-*}" = "screen" ] ); then export GPG_TTY=$(tty)
# Tell tmux to pass the escape sequences through
printf "\ePtmux;\e\e]%s\007\e\\" "$1"
elif [ "${TERM%%-*}" = "screen" ]; then
# GNU screen (screen, screen-256color, screen-256color-bce)
printf "\eP\e]%s\007\e\\" "$1"
else
printf "\e]%s\e\\" "$1"
fi fi
}
if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
alias clear='vterm_printf "51;Evterm-clear-scrollback";tput clear'
fi
vterm_cmd() {
local vterm_elisp
vterm_elisp=""
while [ $# -gt 0 ]; do
vterm_elisp="$vterm_elisp""$(printf '"%s" ' "$(printf "%s" "$1" | sed -e 's|\\|\\\\|g' -e 's|"|\\"|g')")"
shift
done
vterm_printf "51;E$vterm_elisp"
}
find_file() {
vterm_cmd find-file "$(realpath "${@:-.}")"
}
# PLUGINS! # PLUGINS!
# `miniplug update` # `miniplug update`