Skip to content

Commit

Permalink
stdin: really? ick
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Phillips committed Jul 6, 2012
1 parent fe6b846 commit 42cc8b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/luvit/luvit.lua
Expand Up @@ -40,6 +40,7 @@ setmetatable(process, Emitter.meta)
-- leave stderr using lua's blocking implementation
process.stdin = uv.createReadableStdioStream(0)
process.stdin:readStop()
native.unref()
process.stdout = uv.createWriteableStdioStream(1)
process.stderr = uv.createWriteableStdioStream(2)
Expand Down Expand Up @@ -316,5 +317,6 @@ end, traceback))

-- Start the event loop
native.run()

-- trigger exit handlers and exit cleanly
process.exit(process.exitCode or 0)
2 changes: 2 additions & 0 deletions lib/luvit/uv.lua
Expand Up @@ -171,10 +171,12 @@ Tty.getWinsize = native.ttyGetWinsize
Tty.resetMode = native.ttyResetMode

Tty.pause = function(self)
native.unref()
self:readStop()
end

Tty.resume = function(self)
native.ref()
self:readStart()
end

Expand Down

0 comments on commit 42cc8b6

Please sign in to comment.