Skip to content

Instantly share code, notes, and snippets.

@sli
Created July 17, 2011 06:43
Show Gist options
  • Save sli/1087288 to your computer and use it in GitHub Desktop.
Save sli/1087288 to your computer and use it in GitHub Desktop.
Python function to set the title of a terminal window.
import sys
def set_title(text):
sys.stdout.write('\x1b]2;%s\x07' % text)
if __name__ == '__main__':
set_title(sys.argv[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment