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 (limited to '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 From a78d9dd25c4c2d988b425ea0ed3dc190867cd7ca Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Sat, 9 Sep 2023 10:32:30 -0500 Subject: infinite length path in window title and make script executable --- zsh/zscripts/terminalname.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 zsh/zscripts/terminalname.zsh (limited to 'zsh/zscripts/terminalname.zsh') diff --git a/zsh/zscripts/terminalname.zsh b/zsh/zscripts/terminalname.zsh old mode 100644 new mode 100755 index 8543896..6e55d22 --- a/zsh/zscripts/terminalname.zsh +++ b/zsh/zscripts/terminalname.zsh @@ -4,5 +4,5 @@ function xtitle () { # Updates the window title whenever a command is run function precmd () { - xtitle "$(print -P ${USER}@${HOST} %2~)" + xtitle "$(print -P ${USER}@${HOST} %~)" } -- cgit v1.2.3