From 5e382e2cc1ff36d3ba43370d1f94fcd97c847a03 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 3 Aug 2020 14:56:16 +0100 Subject: [PATCH] Add vterm integration needed by emacs-libvterm --- zsh/vterm.zsh | 17 +++++++++++++++++ zshrc | 1 + 2 files changed, 18 insertions(+) create mode 100644 zsh/vterm.zsh diff --git a/zsh/vterm.zsh b/zsh/vterm.zsh new file mode 100644 index 0000000..38e4b39 --- /dev/null +++ b/zsh/vterm.zsh @@ -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 +} diff --git a/zshrc b/zshrc index 94846e3..f78aa6e 100644 --- a/zshrc +++ b/zshrc @@ -102,6 +102,7 @@ source "$DOTZSH/emacs.zsh" source "$DOTZSH/git.zsh" source "$DOTZSH/less.zsh" source "$DOTZSH/tmux.zsh" +source "$DOTZSH/vterm.zsh" # Development source "$DOTZSH/docker.zsh"