Skip to content

Instantly share code, notes, and snippets.

@andrewyates
Created March 11, 2015 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewyates/f988fa8c69ce8503d2b0 to your computer and use it in GitHub Desktop.
Save andrewyates/f988fa8c69ce8503d2b0 to your computer and use it in GitHub Desktop.
set the screen window title to the currently running (or last run) command
# set the screen window title to the currently running (or last run) command
preexec () {
local CMD=${1[(wr)^(*=*|sudo|-*)]}
print -Pn "\ek$CMD $a\e\\"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment