Skip to content
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
Merged

Fix REPL break on improper errors #929

merged 2 commits into from
Oct 5, 2016

Conversation

rhendric
Copy link
Collaborator

@rhendric 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

This line has been in here since Coco, and I can't see any reason why it
should be kept. Can you?
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 Fix #733 Fix REPL break on improper errors Oct 5, 2016
@gkz gkz merged commit 81644ac into gkz:master Oct 5, 2016
@heavyk
Copy link

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
Copy link
Collaborator Author

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.

@rhendric rhendric deleted the repl-errors branch May 4, 2023 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REPL breaks on some errors
3 participants