[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Output pagination
- From: Jay Carlson <nop@...>
- Date: Wed, 19 Apr 2017 13:52:04 -0400
On Apr 19, 2017, at 12:03 PM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
>
> os.execute("stty cbreak </dev/tty >/dev/tty 2>&1")
> [...]
> local key = io.read(1)
> [...]
> os.execute("stty -cbreak </dev/tty >/dev/tty 2>&1");
> end
In case you break out of this loop, your shell may clean up the terminal settings for you. But you may also end up in a mode where stuff like backspace and return don’t work. Too much Unix software has the same problem. The magic Unix keystrokes to fix it:
stty sane^J
but now we may return to our regularly scheduled discussion of resource management in the face of non-local control flow.
--
Jay Carlson
nop@nop.com