mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-20 20:43:09 -04:00
Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Arjan Adriaanse <arjan@adriaan.se>
27 lines
748 B
Bash
Executable File
27 lines
748 B
Bash
Executable File
function 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
|
|
}
|
|
|
|
if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
|
|
function clear(){
|
|
vterm_printf "51;Evterm-clear-scrollback";
|
|
tput clear;
|
|
}
|
|
fi
|
|
|
|
PROMPT_COMMAND='echo -ne "\033]0;\h:\w\007"'
|
|
|
|
vterm_prompt_end(){
|
|
vterm_printf "51;A$(whoami)@$(hostname):$(pwd)"
|
|
}
|
|
PS1=$PS1'\[$(vterm_prompt_end)\]'
|