Content-Length: 381822 | pFad | https://github.com/RustPython/RustPython/pull/711

7B Make the REPL handle line continuation better by coolreader18 · Pull Request #711 · RustPython/RustPython · GitHub
Skip to content

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

Merged
merged 5 commits into from
Mar 22, 2019

Conversation

coolreader18
Copy link
Member

@coolreader18 coolreader18 commented Mar 22, 2019

Edit: this would resolve #626.

@coolreader18 coolreader18 changed the title Make the REPL handle continuation better Make the REPL handle line continuation better Mar 22, 2019
input = String::new();
}
}
}
Err(ReadlineError::Interrupted) => {
// TODO: Raise a real KeyboardInterrupt exception
println!("^C");
break;
continuing = false;
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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")
Copy link
Contributor

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!

@coolreader18 coolreader18 merged commit 18be23a into master Mar 22, 2019
coolreader18 added a commit that referenced this pull request Mar 22, 2019
Make the REPL handle line continuation better #711
@coolreader18 coolreader18 deleted the coolreader18/multiline-repl branch April 9, 2019 18:59
@QGB
Copy link

QGB commented Nov 6, 2019

How to run IPython with ”RustPython" ?

https://stackoverflow.com/questions/16536683/how-to-run-ipython-with-pypy

@coolreader18
Copy link
Member Author

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.

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.

rustpython console closes the stm on the first newline
4 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/RustPython/RustPython/pull/711

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy