aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--home/.bashrc21
1 files changed, 19 insertions, 2 deletions
diff --git a/home/.bashrc b/home/.bashrc
index 62d5c8e..620ea76 100644
--- a/home/.bashrc
+++ b/home/.bashrc
@@ -91,12 +91,29 @@ alias ls="exa -1aFghlmU --git --color=always --sort=name --time-style=iso --grou
91 91
92 92
93######################################################################## 93########################################################################
94# Fix for Emacs vterm 94# Fixes for Emacs vterm
95##################### 95#######################
96vterm_printf() {
97 if [ -n "$TMUX" ] && ([ "${TERM%%-*}" = "tmux" ] || [ "${TERM%%-*}" = "screen" ]); then
98 # Tell tmux to pass the escape sequences through
99 printf "\ePtmux;\e\e]%s\007\e\\" "$1"
100 elif [ "${TERM%%-*}" = "screen" ]; then
101 # GNU screen (screen, screen-256color, screen-256color-bce)
102 printf "\eP\e]%s\007\e\\" "$1"
103 else
104 printf "\e]%s\e\\" "$1"
105 fi
106}
107
96if [[ "$INSIDE_EMACS" = 'vterm' ]]; then 108if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
97 function clear() { 109 function clear() {
98 vterm_printf "51;Evterm-clear-scrollback"; 110 vterm_printf "51;Evterm-clear-scrollback";
99 tput clear; 111 tput clear;
100 } 112 }
101fi 113fi
114
115vterm_prompt_end(){
116 vterm_printf "51;A$(whoami)@$(hostname):$(pwd)"
117}
118PS1=$PS1'\[$(vterm_prompt_end)\]'
102######################################################################## 119########################################################################