BlueAmulet / OCEmu

OpenComputers Emulator in Lua. Depreciated
92 stars 35 forks source link

attempt to call method 'pull' (a nil value) #50

Open LoganDark opened 6 years ago

LoganDark commented 6 years ago

I don't know if this is an OpenOS issue or an OCEmu issue, but man is probably tested to work fine in-game, so I'm filing an issue here.

If you run more with text bigger than your screen (or any command that uses more), e.g. man ls or man grep, it crashes with this error:

image

Raw text:

/bin/more.lua:33: attempt to call method 'pull' (a nil value):
stack traceback:
    /bin/more.lua:33: in function 'scroll'
    /bin/tty.lua:97: in function 'write'
    /bin/buffer.lua:167: in function </lib/buffer.lua:147>
    (...tail calls...)
    /bin/cat.lua:32: in main chunk
    (...tail calls...)
    [C]: in function 'xpcall'
    machine:791: in function 'xpcall'
    /lib/process.lua:63: in function </lib/process.lua:59>

Offending line of code:

        local _, _, _, code = original_stream:pull(nil, "key_down") -- nil timeout is math.huge

where original_stream is io.stdout.stream.