Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Get The Number Of Columns And Rows In A Terminal Window With ENV Vars

ENV Vars

Both `bash`` and `zsh`` set environmental vars for the number of columns and lines/rows in a terminal window. For example:

Code

echo $COLUMNS

-- results

56

Code

echo $ROWS

-- results

38

References

  • Use `tputs`` To Get The Number Of Columns And Lines/Rows Count In A Terminal Window On A Mac