FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Make the REPL handle line continuation better by coolreader18 · Pull Request #711 · RustPython/RustPython · GitHub

Repository navigation

Make the REPL handle line continuation better - #711

Merged
coolreader18 merged 5 commits into
masterfrom
coolreader18/multiline-repl
Mar 22, 2019
Merged

coolreader18 merged 5 commits into
masterfrom
coolreader18/multiline-repl

Conversation

coolreader18 commented Mar 22, 2019 •
edited
Loading

Copy link
Copy Markdown
Member

Edit: this would resolve #626.

coolreader18 changed the title Make the REPL handle continuation better Make the REPL handle line continuation better Mar 22, 2019
Comment thread src/main.rs
// TODO: Raise a real KeyboardInterrupt exception
println!("^C");
break;
continuing = false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think we should quit when hitting CTR+C, right? Now we continue.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Okay, in that case, nice job!

Comment thread src/main.rs Outdated
Comment thread src/main.rs Outdated
Comment thread src/main.rs
loop {
match repl.readline(prompt) {
let prompt = if continuing {
get_prompt(vm, "ps2")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Btw, this also fixes changing sys.ps1 on the fly!

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 deleted the coolreader18/multiline-repl branch April 9, 2019 18:59

QGB commented Nov 6, 2019

Copy link
Copy Markdown

How to run IPython with ”RustPython" ?

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

Copy link
Copy Markdown
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.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL