aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-emacs/vterm/files/bashrc')
-rwxr-xr-xapp-emacs/vterm/files/bashrc26
1 files changed, 26 insertions, 0 deletions
diff --git a/app-emacs/vterm/files/bashrc b/app-emacs/vterm/files/bashrc
new file mode 100755
index 000000000..bafa9f16e
--- /dev/null
+++ b/app-emacs/vterm/files/bashrc
@@ -0,0 +1,26 @@
+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)\]'