Comment

Comment by MaulingMonkey

Some edge cases:

- cat /dev/urandom (cat can't reasonably tell if you've piped to another command that expects raw binary data or a terminal that expects to be left in a sane state)

- ssh remotehost cat /dev/urandom (ditto)

- Emergency exit to avoid data loss when detecting e.g. memory corruption (lesser evil)

- Hardware bugs/failures erroneously emitting escape codes (memory bit flips, loose RS-232 connections)

You're of course correct that the vastly preferred thing to do when practical is to clean up when reasonable to do so - and it's probably reasonable to do so.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton