Add vterm integration needed by emacs-libvterm

This commit is contained in:
2020-08-03 14:56:16 +01:00
parent 3dcc9a5545
commit 5e382e2cc1
2 changed files with 18 additions and 0 deletions

17
zsh/vterm.zsh Normal file
View File

@@ -0,0 +1,17 @@
#
# vterm Integration
# https://github.com/akermu/emacs-libvterm#shell-side-configuration
#
vterm_printf(){
if [ -n "$TMUX" ]; then
# Tell tmux to pass the escape sequences through
# (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
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
}