Skip to content

Instantly share code, notes, and snippets.

@cmittendorf
Last active August 29, 2015 13:59
Show Gist options
  • Save cmittendorf/10969665 to your computer and use it in GitHub Desktop.
Save cmittendorf/10969665 to your computer and use it in GitHub Desktop.
Set the size of the current terminal to number of columns and rows.
#!/usr/bin/env bash
if [ $# != 0 -a $# != 2 ]; then
echo `basename $0`" <cols> <rows>"
exit
fi
COLS=${1:-80}
ROWS=${2:-25}
osascript << EOF
tell application "Terminal"
tell first window
tell first tab
set number of columns to ${COLS}
set number of rows to ${ROWS}
end tell
end tell
end tell
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment