title: How do I find the width & height of a terminal window?
body: <p>As a simple example, I want to write a CLI script which can print <code>=</code> across the entire width of the terminal window.</p>
  
  <pre><code>#!/usr/bin/env php
  &lt;?php
  echo str_repeat('=', ???);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>#!/usr/bin/env python
  print '=' * ???
  </code></pre>
  
  <p>or</p>
  
  <pre><code>#!/usr/bin/env bash
  x=0
  while [ $x -lt ??? ]; do echo -n '='; let x=$x+1 done; echo
  </code></pre>