New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix REPL break on improper errors #929

Merged
merged 2 commits into from Oct 5, 2016

Conversation

Projects
None yet
3 participants
@rhendric
Collaborator

rhendric commented Oct 5, 2016

This is an ugly hack, but it fixes the issue where the REPL will
sometimes stop responding to arrow keys after an error has been thrown
in user code. Turns out, this happens whenever a string (or anything
other than something with Error in its prototype hierarchy) is thrown.
The fix is to restore "raw mode" on the input TTY handle when this
situation is detected, by the time-honored method of turning it off and
on again.

There's also a (basically) one-line commit in here that cleans up a double [Function] message that has been hanging around since Coco.

Close #733

rhendric added some commits Oct 5, 2016

repl: remove double [Function] message
This line has been in here since Coco, and I can't see any reason why it
should be kept. Can you?
repl: fix break on improper errors
This is an ugly hack, but it fixes the issue where the REPL will
sometimes stop responding to arrow keys after an error has been thrown
in user code. Turns out, this happens whenever a string (or anything
other than something with Error in its prototype hierarchy) is thrown.
The fix is to restore "raw mode" on the input TTY handle when this
situation is detected, by the time-honored method of turning it off and
on again.

@rhendric rhendric changed the title from Fix #733 to Fix REPL break on improper errors Oct 5, 2016

@gkz gkz merged commit 81644ac into gkz:master Oct 5, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@heavyk

This comment has been minimized.

heavyk commented Oct 5, 2016

what happened to the full repl implementation that was there last night?

I was gonna give it a go today... looked pretty extensive

edit; oops, nevermind... didn't see the there were two prs... nice!

@rhendric

This comment has been minimized.

Collaborator

rhendric commented Oct 5, 2016

Almost all of that REPL code is still there; I just pulled it out of command.ls into repl.ls in another recently merged commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment