Skip to content
Ricky
English

Search

Searching… No matching pages. Matching pages are listed below. Search is unavailable. Please try again.

Rules that terminal programs follow

  • Ricky Lin
  • 1 minute
  • “Rules” that terminal programs follow

  • rule 1: noninteractive programs should quit when you press Ctrl-C

  • rule 2: TUIs should quit when you press q

  • rule 3: REPLs should quit when you press Ctrl-D on an empty line

  • rule 4: don’t use more than 16 colours

  • rule 5: vaguely support readline keybindings

    • rule 5.1: Ctrl-W should delete the last word
  • rule 6: disable colours when writing to a pipe

  • rule 7: - means stdin/stdout