2 ms·
Technically the difference is clear. Return is for character based protocols, teletypes, ttys, VT100, ssh and the like. Enter is for IBM 3278 style where a "sc
by usr1106 1y ago
Technically the difference is clear. Return is for character based protocols, teletypes, ttys, VT100, ssh and the like.
Enter is for IBM 3278 style where a "screenful" or form of inputs is buffered by the terminal and sent as a whole when the user presses enter or send. Fewer interrupts and context switches at the mainframe. Required even its own ssh client. Return key exists, too, and can be part of the buffered data record.
In practice the enter term leaked into the character-based world.
- SoftTalker 1y agoAnd of course ASCII separates them, with LF (linefeed, sometimes called newline) and CR (carriage return, or just return) being two separate characters. Windows (and probably some other) text file conventions used CR+LF to end a line, while unix conventions used just LF (hence the alternate name of "newline").
- chowells 1y agoIn line printers, a line feed moves the paper forward one line. A carriage return moves the print head back to the start of a line. You can do interesting things by making them separate commands, like bold text (overstrike) or underlining, so they were independent commands for talking to a line printer. ASCII standardized on a character set containing control codes for line printers, so it included CR and LF separately. It's a bit weird that some terminals changed the semantics of those control codes, but I guess things never stay static in time.
- rswail 1y agoLine printers (also "chain printers" from IBM) used "form feed" to move the paper to the next "form", which for the most part was moving the tractor fed paper to the line after the page perforations. The printers either kept track of the number of lines printed "so far", or, in the case of a chain printer, there was a literal chain (similar to an engine timing belt) that had a particular location that was supposed to be aligned with the paper perforation. Standard tractor feed paper had a printable area that was 132 monospaced characters wide (13.2") and 11" high. Tractor feed paper had the holes at a standard distance apart vertically and a standard margin to allow for the tractor holes and an area before printing, so that the paper could also have vertical perforations to remove the tractor feed paper after printing. Teletypes were 72 characters wide and 0.1" line height and used continuous paper rolls.
- yencabulator 1y agoThis is hazy memory but I think Return worked like one would expect inside of multiline fields on those IBM terminals. That is, they used both Enter and Return, for different purposes. Also, if you're ever mystified by SQL's CHAR/VARCHAR handling of trailing whitespace, look into IBM "block-based" terminals and their text input and the conventions match exactly.