lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> On Aug 2, 2022, at 18:32, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> 
> See http://lua-users.org/lists/lua-l/2012-09/msg00352.html

Luciano,

As Luis suggests, the data is being buffered in the tty driver down in the OS until you hit the return key.  Then the tty driver sends the line up to the process.  The process reads one character as you have instructed it.

This is called “cooked” mode in old BSD parlance.  What you want is “raw” mode.  Depending upon the underlying OS, this is done by different means.  As the original author warns, the tty mode should be saved first and then restored.  And, also as he says, this may not work on the OS you are using. e.g. in particular, I have no idea how to do these things on Windows.

Good luck,
Perry

Attachment: signature.asc
Description: Message signed with OpenPGP