summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zsh/zscripts/terminalname.zsh8
1 files changed, 8 insertions, 0 deletions
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~)"
+}