dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 7cf5b523578def921869952138d06a6b890a36e4
parent 4d5c7130fe90d2482a2f4ee48eeb419f3c808b06
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Thu, 26 Apr 2018 19:55:38 -0400

Adjust title settings

Diffstat:
M.zshrc | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/.zshrc b/.zshrc @@ -34,9 +34,12 @@ RPS1="[%?]" PS1="%{$usercolor%}%n%{$reset%}@%{$fg[green]%}%m:%{$reset%}%c%{$fg[red]%}\$(__git_ps1 \" (%s)\")%{$reset%}%(!.#.\$) " unset usercolor reset -_set_title() { echo -ne "\033]0;$USER@$HOST:$1\007" } -precmd() { _set_title "$PWD" } -preexec() { _set_title "$1" } +preexec() +{ + base=`echo $2|cut -d ' ' -f 1` + print -Pn "\033]0;%n@%m:`basename $base`\007" +} +precmd() { print -Pn "\033]0;%n@%m:%~\007" } [ -d /usr/share/zsh/site-functions/ ] && fpath=(/usr/share/zsh/site-functions/ $fpath) [ -d "$HOME/.zsh/functions" ] && fpath=("$HOME/.zsh/functions" $fpath)