mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Fix 'Error: EBADF: bad file descriptor, write' on .exit in REPL
Fixes issue #4252.
This commit is contained in:
committed by
Michael Ficarra
parent
88192c197a
commit
7c2f348a63
@@ -138,7 +138,7 @@
|
||||
} catch (error) {}
|
||||
fd = fs.openSync(filename, 'a');
|
||||
repl.rli.addListener('line', function(code) {
|
||||
if (code && code.length && code !== '.history' && lastLine !== code) {
|
||||
if (code && code.length && code !== '.history' && code !== '.exit' && lastLine !== code) {
|
||||
fs.write(fd, code + "\n");
|
||||
return lastLine = code;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user