mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Merge pull request #3952 from sixmen/fix_write_after_fin
fix write after FIN error when using repl via socket
This commit is contained in:
@@ -185,7 +185,9 @@
|
||||
runInContext(opts.prelude, repl.context, 'prelude');
|
||||
}
|
||||
repl.on('exit', function() {
|
||||
return repl.outputStream.write('\n');
|
||||
if (!repl.rli.closed) {
|
||||
return repl.outputStream.write('\n');
|
||||
}
|
||||
});
|
||||
addMultilineHandler(repl);
|
||||
if (opts.historyFile) {
|
||||
|
||||
@@ -152,7 +152,7 @@ module.exports =
|
||||
opts = merge replDefaults, opts
|
||||
repl = nodeREPL.start opts
|
||||
runInContext opts.prelude, repl.context, 'prelude' if opts.prelude
|
||||
repl.on 'exit', -> repl.outputStream.write '\n'
|
||||
repl.on 'exit', -> repl.outputStream.write '\n' if not repl.rli.closed
|
||||
addMultilineHandler repl
|
||||
addHistory repl, opts.historyFile, opts.historyMaxInputSize if opts.historyFile
|
||||
# Adapt help inherited from the node REPL
|
||||
|
||||
Reference in New Issue
Block a user