3 ms·
> For a cli text editor, ed would qualify, right? It'd still say ed is more of a TUI than CLI, albeit kind of old-school since it doesn't redraw the screen, ju
by diggan 1y ago
> For a cli text editor, ed would qualify, right?
It'd still say ed is more of a TUI than CLI, albeit kind of old-school since it doesn't redraw the screen, just continuously show output and let you enter commands. Maybe "REPL" comes closer, because it's not interactive in the typical TUI way.
- hamburglar 1y agoIs it actually important that we come up with a formal definition of these things, though? They are colloquial terms, there is some overlap, and people are always going to use one or the other “incorrectly” according to you. It’s more important that we recognize that’s a potential source of differing terminology and ignore that rather than fixating on it.
- Jenk 1y agoEd was designed in an age where the visual interface was a printer - so it is most assuredly a cli tool :)
- deleted 1y ago[deleted]
- WD-42 1y agoNot sure why you are downvoted this is entirely correct
- spauldo 1y agoProbably because most of us don't think it's correct at all. TUI apps aren't common anymore, which adds to the confusion as a lot of people didn't grow up with them and don't grasp the difference. A TUI app takes control of the terminal and redraws different parts of the screen to present a consistent, non-scrolling experience. If you've ever used a system where your interface was an IBM 3270 emulator (or better, an actual 3270 terminal), that's TUI. vi/vim and non-GUI Emacs are also TUI. A CLI app just prints its output at the cursor and the output scrolls off the top of the screen as you go. The Bourne, Korn, Bourne Again, and C shells are all CLI, as are most REPLs and the majority of interactive non-GUI UNIX programs (including ed) these days.
- layer8 1y agoI fail to see the difference between REPL and CLI here. Any line-based interactive interface where you type commands is a CLI, like for example the ftp or mysql clients in interactive mode. Or, indeed, ed.
- MobiusHorizons 1y agoPersonally I usually make the distinction based on whether the process has to switch the tty to raw mode and overwrites the full screen (typically using ncurses), but it sounds like the person you are replying to makes the distinction in whether the program needs user input while executing. I guess such programs are more likely to work in pipelines or shell scripts
- layer8 1y agoUnix shells “need user input while executing” in that sense. A program not being a Unix shell doesn’t make it non-CLI. A shell constitutes a CLI due to its interactive line-based user interface. Any other program with such an interface counts as being a CLI program for the same reason.
- kristjansson 1y agoCould you run it on an actual teletype without consuming an entire forest worth of paper? That’s a CLI. Otherwise it’s a TUI.
- layer8 1y agoI don’t agree, it’s consecutive line output vs. screen-based rendering and repositioning. Regardless, ed was developed for and used on actual teletypes. It’s entire interface is geared towards that usage.
- Brian_K_White 1y agoI think ed also served the function of sed and patch. Ie you could record a bunch of edits into a file and it could read the script and perform all the edits to some input file. So it was more useful than an interactive line based editor sounds.