-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Make the REPL handle line continuation better #711
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
Conversation
input = String::new(); | ||
} | ||
} | ||
} | ||
Err(ReadlineError::Interrupted) => { | ||
// TODO: Raise a real KeyboardInterrupt exception | ||
println!("^C"); | ||
break; | ||
continuing = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should quit when hitting CTR+C, right? Now we continue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right. I should've discussed this before making the change, but usually in shells (iPython, bash/zsh/sh/sshshshshshs), ^C just cancels what you're currently typing, it doesn't completely end the shell like ^D does. I found it to be sort of annoying when testing something in the REPL, so I changed it here; if you disagree with it I can change it back though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, in that case, nice job!
|
||
loop { | ||
match repl.readline(prompt) { | ||
let prompt = if continuing { | ||
get_prompt(vm, "ps2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, this also fixes changing sys.ps1
on the fly!
Make the REPL handle line continuation better #711
How to run IPython with ”RustPython" ? https://stackoverflow.com/questions/16536683/how-to-run-ipython-with-pypy |
I think it would be possible, but I don't think RustPython is at a point yet where it would be able to run a project as complex as IPython. |
Edit: this would resolve #626.