OT What does RET (Enter) do and how does it do it ??

Mikkel L. Ellertson mikkel at infinity-ltd.com
Sat Aug 25 22:24:28 UTC 2007


Aaron Konstam wrote:
> 
> It seems to me that there is a point that is being missed. What you type
> on the keyboard is just a continuous stream of characters. A line feed
> which you get in Linux when you hit return is just a character like any
> other. When you hit a g the letter g is printed. When  a text editor is
> analyzes the line feed it knows to go to the next line. When the shell
> sees the line feed it knows it is to treat everything on the line up to
> the line feed as a command. No magic is involved and it is really very
> simple.
> 
It is on an even lower level that that - when you hit a g, a g may
or may not be printed, depending on what is being done with the
input. (For example, if I am playing a movie with mplayer, f toggles
full screen mode, but is never printed.) Now, there are some
libraries that make thing easy for the programmer. The reason that
the editing keys work the same in so many programs is that they are
using the readline library routines. (man readline)

You also have all the terminal control characters that can come into
play, depending on the interface and settings. (man stty)

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20070825/6acb86c4/attachment-0002.bin 


More information about the users mailing list