Skip to content

Instantly share code, notes, and snippets.

@acook
Created March 8, 2014 22:06
Show Gist options
  • Save acook/9439618 to your computer and use it in GitHub Desktop.
Save acook/9439618 to your computer and use it in GitHub Desktop.
# update window title with command
function preexec {
commandline="$1" # the user-entered commandline is passed in as first arg
args=${${(z)commandline}[2,-1]} # get command's args
new_title=${args:-$PWD} # if no args, then use the pwd
set_window_title $new_title
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment