1. 28
  1.  

  2. 4

    an aside, but it’s super weird that programs can detect if output is being redirected.

    “It’s all text” really ends up generating a bunch of weird hacks doesn’t it

    1. 2

      “It’s all stdout” really. The hacks are there precisely because it’s not all text :)

      1. 1

        I was curious about that too.
        Edit: Ahh, found it:
        isatty
        Usage

      2. 2

        Looking for zeroes… I take note of the trick!

        1. 2

          This is the same trick that GNU grep uses as well, although I don’t know its origins. IIRC, GNU grep checks for a zero byte anywhere in the file.

          1. 4

            Openbsd grew does the same. There were some experiments with more elaborate checks, but they tended to fail in weird ways. A zero byte check turns out to be pretty reliable.

        2. 1

          Thank goodness. This updated behaviour is a lot more sensible.

          1. 1