~kota/dots

16d62a7d24727a5ac60e6882853ea21463d92669 — Dakota Walsh 1 year, 9 months ago 585278b
set alacritty's title
1 files changed, 15 insertions(+), 0 deletions(-)

M zsh/.zshrc
M zsh/.zshrc => zsh/.zshrc +15 -0
@@ 118,3 118,18 @@ n ()
		rm -f "$NNN_TMPFILE" > /dev/null
	fi
}

# Set title for terminal
case "$TERM" in (rxvt|rxvt-*|st|st-*|*xterm*|(dt|k|E)term)
    local term_title () { print -n "\e]0;${(j: :q)@}\a" }
    precmd () {
      local DIR="$(print -P '[%c]%#')"
      term_title "zsh"
    }
    preexec () {
      local DIR="$(print -P '[%c]%#')"
      local CMD="${(j:\n:)${(f)1}}"
      term_title "$CMD"
    }
  ;;
esac