-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Compatibility with IPython 7 #23
base: master
Are you sure you want to change the base?
Conversation
I appreciate rlipython is not a big priority in the IPython community so if you're interested in extra manpower I'd be happy to take it on as a maintainer. |
It works like a charm on my side! Thanks a lot for this :) |
Still having some problems with the new branch. Using within Powershell on Windows 10:
so I pip installed pyreadline. Then I got an iPython prompt, but I tried to run an assignment statement and got
|
Thanks @baogorek, I'll take a look when I get the chance. |
Thanks @cc-a. I just cleaned up my environment and got a little further. With a Python3.6.8 virtual environment with iPython 7.9.0, pyreadline, and this branch installed (still Windows 10), the following command:
produced a working console. But there are some pretty gnarly side effects:
|
I was able to get to the same state. The mangled output looks like colour codes, for some reason not being understood correctly by powershell (despite input prompts being coloured correctly). Should be possible to disable colour output as a workaround, though obviously not ideal. Could you also try multiline statements? I found these were severely broken. Whats the use case for rlipython in powershell out of interest? |
Yeah, @cc-a, you're not kidding about multiline statements. I tried a for loop and iPython went into what appeared to be an infinite exception recursion. I'll paste some of that code at the bottom. About the use case (and thanks for asking), there are times where developing on Windows Subsystem for Linux isn't convenient (e.g., plotting statistical charts), and I am desperately trying to mimic my Linux setup on Windows. That setup is based on tmux, vim, and a vim plugin called Slimux that allows me to send code from any pane to any other pane. It works perfectly. I had almost given up on Windows when 1) I realized I could run NeoVim in a Powershell console just like vim, 2) I discovered iron.nvim and nvimux which got me pretty close to my Linux setup on Windows. I'm able to press a key combo and send highlighted text to R, Powershell, and just about any other REPL...except iPython. Extra characters are a problem but the real headache is that iPython will not execute commands, no matter how many newlines you send. I found a recently created iron.nvim issue about sending code to iPython and starting digging in. The problem seemed to be the same one from this Emacs Q&A where it was explained that IPython's new terminal interface was responsible for Emacs users not being able to send their code to the REPL. A workaround was suggested in the Stumbling upon this repo was the first place that I learned about the prompt_toolkit, and it gave me hope that maybe I'd be able to send commands from vim to a functional iPython and have them execute. And if it worked there, it'd probably work on Emacs. And that would make a lot of people happy. Portion of the error messages:
|
🤣 Oh the lengths we go to to avoid having to take our hands off of the keyboard. Not sure how I feel about helping vim users either 😉 I probably won't get a decent chance to look at this before the weekend. Frankly I'm quite unsure how to proceed with the colour code issue. The multiline issue should be resolvable anyway and can be worked around in the meantime with the --no-autoindent flag. |
The issue with multiline commands are now resolved. Regarding the colour codes in the output, I'm still not really sure where to start looking. This also seems to be an issue that was present in older versions and not related to the changes here so this PR isn't really the right place to fix it. |
@cc-a, 10-4. I also tried your branch and things were working fine, with the exception of the color codes. |
Alright, figured out the colour codes thing and created #24 for the change. I've merged the changes for both this PR and #24 into master on my fork for easy combination. So you should be able to get a fully functioning ipython shell from scratch with: |
Gentle ping. Any chance this get merged soon? |
Some minor revisions to accommodate changes made with Ipython7 swapping from IPython.core.inputsplitter to IPython.core.inputtransformer2.
I believe this closes #21