remove unused opts
use istty
make the example more accurate
Merge branch 'tty'

* tty:
  make the example more accurate
  use istty
  remove unused opts