Sunday, May 5, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 724  / 2 Years ago, thu, july 14, 2022, 6:53:53

Something that (for me) doesn't make sense is that terminals don't act like other text areas, like when we write on a text editor or on your browser. Features like copy and paste, select text, etc, work differently in a terminal.


Is it possible to run a terminal that works like a normal text editor, that just runs the command we wrote when we press some key?


Edit


To make myself clearer, what I am asking is exact what @Ghos3t pointed out in the comments:



I think everyone is missing the meaning of what OP is asking, he doesn't want a terminal text editor like nano, he's talking about the text prompt where we type terminal commands, and why that does not follow the conventions like any normal text box, such as having the option to hit Ctrl/Cmd + A to select an entire line and hit backspace to delete it instead of having to backspace one char at a time, or the fact that normal copy and paste commands don't work in some terminals etc. Why can't the terminal text prompt just work like the VSCode command palate.



Can we have a terminal that strictly follows the same patterns as the text editors? And why terminals follow different patterns than text areas?


More From » command-line

 Answers
3

Because terminals are in fact terminal emulators. They emulate hardware that are line based. and because they come from a very distant past. First terminals were no smarter that a typewriter.


Nowadays, we have screens that can be redrwawn at will. In a text editor, you can click anywhere to set the insertion cursor wherever you want, but back in the older days, there was no screen. There was just a printer and a keyboard. Eventually, you can erase the last character you've typed, or kill the whole line, but not much.


Over time, terminals (the hardware one) became more capable and smarter, and eventually the mythical VT100 came to existence. terminal emulators that we use today emulate a VT100, more or less, with some additions (for example, current terminal emulators correctly handle national char : european languages and their weird symbols (ç Æ, ñ, Å...), greek, hebrew, asian languages, in fact most unicode symbols)


Their set of commands existed before graphical UI existed. In a terminal, Control-C is caught by the terminal driver and mapped to a signal that kindly ask the current process to terminate. This is history. Also note that in a terminal, you don't really edit text (not counting the fact that you can run editors in full screen mode), you type a letter, this letter is sent to the computer, the computer sends back the letter and this letter is thus printed on screen. When you hit enter, the remote computer executes the command and you just receive output.


Why didn' we invent terminals where we can edit like in any other text window ? Because it does not make sense. A terminal is sequential : logically we type in sequence a command and get an answer. Also because of how it works. each character is sent and when (if) it comes back, it is printed on screen. How does a mouse cursor, mobile insertion cursor fits in this model ?


https://en.wikipedia.org/wiki/Computer_terminal


[#395] Saturday, July 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
allowiel

Total Points: 189
Total Questions: 103
Total Answers: 105

Location: Slovenia
Member since Thu, Mar 18, 2021
3 Years ago
allowiel questions
;