Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Mark descriptor as terminal for the -t test



On Jun 3,  6:30pm, Sebastian Gniazdowski wrote:
}
} A robust program, the script. Recalls asciinema.

The other way around, really: "script" has been around for decades.

} Turns out the commands are not so confused. Either they assume there
} is no terminal, and strip terminal control codes from output, or
} ignore the fact (e.g. vim) and work well.

The third thing that some programs do is to look harder for a terminal,
e.g. examine all of stdin/out/err with isatty() and direct all I/O to
whichever of them is found to be a terminal.  (Recall the discussion of
a few weeks ago regarding descriptors opened for both read and write
even though in practice they are only used for one or the other.)

} to strip control codes, but have no motivation to do so. The dream of
} "reuse output without mouse" is better to be implemented at terminal
} level.

Output that is screen-oriented rather than stream-oriented is also not
suitable for re-use anyway, at least not directly.

You might also look at Functions/Zle/keeper for a related idea.



Messages sorted by: Reverse Date, Date, Thread, Author