Last active
January 1, 2019 15:23
-
-
Save arielshaqed/d45576d4d59616c3f3f591a86b96ce9e to your computer and use it in GitHub Desktop.
Resize an iTerm* or xterm or ...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# Generates a control sequence for resizing a window. These are all | |
# described at https://invisible-island.net/xterm/ctlseqs/ctlseqs.html. | |
import click | |
@click.command() | |
@click.option('--rows', default=60, help='Number of rows.') | |
@click.option('--cols', default=80, help='Number of columns.') | |
def resize(rows, cols): | |
print("\x1b[8;{rows};{cols}t".format(rows=rows, cols=cols)) | |
if __name__ == '__main__': | |
resize() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment