aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriele Bozzola <sbozzolator@gmail.com>2020-10-23 07:36:02 -0700
committerjixiuf <jixiuf@qq.com>2020-11-13 23:31:06 +0800
commita89679946e47ad22e52f4aaf6f5ea280b8871ad0 (patch)
tree1c6b374b2f9cca9f12f9d653f1763fbd00bba306
parent7bd4f21ba804b78e132a1b27d83d6051e444f524 (diff)
Use bash variable instead of escape sequences
Fixes #334
-rw-r--r--README.md2
-rw-r--r--etc/emacs-vterm-bash.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/README.md b/README.md
index d5a6872..75e5aeb 100644
--- a/README.md
+++ b/README.md
@@ -429,7 +429,7 @@ add-zsh-hook -Uz chpwd (){ print -Pn "\e]2;%m:%2~\a" }
```
For `bash`,
```bash
-PROMPT_COMMAND='echo -ne "\033]0;\h:\w\007"'
+PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME}:${PWD}\007"'
```
For `fish`,
```fish
diff --git a/etc/emacs-vterm-bash.sh b/etc/emacs-vterm-bash.sh
index 15bf353..0fb1ca2 100644
--- a/etc/emacs-vterm-bash.sh
+++ b/etc/emacs-vterm-bash.sh
@@ -42,7 +42,7 @@ vterm_cmd() {
# This is to change the title of the buffer based on information provided by the
# shell. See, http://tldp.org/HOWTO/Xterm-Title-4.html, for the meaning of the
# various symbols.
-PROMPT_COMMAND='echo -ne "\033]0;\h:\w\007"'
+PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME}:${PWD}\007"'
# Sync directory and host in the shell with Emacs's current directory.
# You may need to manually specify the hostname instead of $(hostname) in case