Hacker News new | ask | show | jobs
by dtj1123 22 days ago
I like TUIs because I can pipe the output of CLIs directly into them, and I don't have to leave my terminal environment. GUIs can't compete with that.
2 comments

TUI and CLI isn't the same thing. A badly written TUI will fail to check isatty() on stdin and will dump ANSI escape codes, which are not trivial to remove from the output as they follow a format that has different formats, lengths and sentinels that denote the ending.
I'm fully aware they're not the same thing, I'll not sure what gave you the impression I think they are.

I agree that a badly written TUI is... badly written? Obviously I'm referring to well executed TUIs.

For example, I regularly pipe the result of ls, grep or fd into Helix then use multicursor editing to set up a script. You simply can't do that with a GUI.

Those are not TUIs, or rather, when we say TUI we usually mean interactive UI in the terminal.
GP claims:

> I regularly pipe the result of ls, grep or fd into Helix

Helix is being identified as the TUI here. Terminal text editors are very much interactive.

Helix is a TUI.

Perhaps you should read my comments more carefully before writing a reply.

    ls | gvim -
or in PowerShell

    gci | ogv -PassThru
Programs which call GUI library functions can read stdin too... why wouldn't they be able to?
Gvim is a TUI with a GUI taped on top, and whilst the PowerShell you've given there does call a GUI library function as described, I'm pretty sure the author is referring to non trivial examples of a GUI like sublime or VS Code.