From 394204d20c551cc428c24ded331ef812ef3e6653 Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Sat, 9 Sep 2023 08:51:32 -0500 Subject: script to change terminal window name to match prompt --- zsh/zscripts/terminalname.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 zsh/zscripts/terminalname.zsh diff --git a/zsh/zscripts/terminalname.zsh b/zsh/zscripts/terminalname.zsh new file mode 100644 index 0000000..8543896 --- /dev/null +++ b/zsh/zscripts/terminalname.zsh @@ -0,0 +1,8 @@ +function xtitle () { + builtin print -n -- "\e]0;$@\a" +} + +# Updates the window title whenever a command is run +function precmd () { + xtitle "$(print -P ${USER}@${HOST} %2~)" +} -- cgit v1.2.3