summary refs log tree commit diff
path: root/.zsh/title.zsh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.zsh/title.zsh12
1 files changed, 8 insertions, 4 deletions
diff --git a/.zsh/title.zsh b/.zsh/title.zsh
index b0d7ad70..5a00c458 100644
--- a/.zsh/title.zsh
+++ b/.zsh/title.zsh
@@ -1,9 +1,9 @@
 function _title {
-  echo -en "\033]0;$@\a"
+  print -Pn "\033]0;$@\a"
 }
 
 function title {
-  if [ -n "$1" ]; then
+  if [[ -n "$1" ]]; then
     _title_custom=1
     _title $@
   else
@@ -13,14 +13,18 @@ function title {
 }
 
 function _title_preexec {
-  [ -z "$_title_custom" ] && _title "$1"
+  [[ -z "$_title_custom" ]] && _title "$1"
 }
 
+unset _title_host
+[[ -n "$SSH_CLIENT" ]] && _title_host='%m:'
+
 function _title_precmd {
-  [ -z "$_title_custom" ] && _title zsh
+  [[ -z "$_title_custom" ]] && _title '$_title_host%1~$(gitprompt nocolor)'
 }
 
 typeset -ga preexec_functions
 typeset -ga precmd_functions
+
 preexec_functions+='_title_preexec'
 precmd_functions+='_title_precmd'
commit/bin/man1/htagml.1?id=284c1b390e03c108e1de90101ec0884203b2227f&follow=1'>Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe 2021-01-12Split fields by tab onlyJune McEnroe 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe