lua-users home
lua-l archive

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


Yes that does work.  However

while true do os.execute('echo hello world') end

cannot be stopped with ^C.  The only way to end it is to kill the whole terminal session.

Is there something about calling os.execute that prevents it from seeing ^C?  Perhaps the ^C is being caught by the new shell that os.execute starts?


On May 14, 2013, at 5:02 AM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:

>> I thought that control-C would end a function running in the interpreter and return me to the interpreter's command line
> 
> It does:
> 
>      % lua
>      Lua 5.2.2  Copyright (C) 1994-2013 Lua.org, PUC-Rio
>> while true do end
>      ^Cinterrupted!
>      stack traceback:
> 	      stdin:1: in main chunk
> 	      [C]: in ?
>> 
> 
> Just don't press it twice in a row.
>