Last active
October 6, 2015 06:58
-
-
Save kghost/2954483 to your computer and use it in GitHub Desktop.
ttyresize.sh
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
#! /bin/bash | |
tty -s || exit 1 | |
trap '' 1 2 3 18 | |
stty -echo | |
echo 1b5b313874 | xxd -ps -r | |
read -d t c | |
stty echo | |
`echo $c | sed -ne 's/\x1b\[8;\([0-9]*\);\([0-9]*\)$/stty rows \1 cols \2/p'` | |
stty echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment