Skip to content

Instantly share code, notes, and snippets.

@eschen42
Created October 25, 2018 16:24
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 eschen42/610e16008175e5b0be4dda83bbeb8cfd to your computer and use it in GitHub Desktop.
Save eschen42/610e16008175e5b0be4dda83bbeb8cfd to your computer and use it in GitHub Desktop.
get tty columns on Debian
#!/usr/bin/env bash
export ROWCOL="$(stty -a | head -n 1 | grep columns | sed -n -e 's/speed [0-9]* baud; rows \([0-9]*\); columns \([0-9]*\);.*/export LINES=\1; export COLUMNS=\2 /; s/.*speed//; p')"
$ROWCOL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment