-
Notifications
You must be signed in to change notification settings - Fork 144
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
Fixes for modern readline #120
Conversation
Should address issues described in takluyver#117 et al. Additionally, I've added code to set the TERM_PROGRAM and TERM_PROGRAM_VERSION env vars so others can set variables accordingly. This *might* not be ideal, as perhaps bashrc has executed before these are set. Please advise if that's the case.
It's a dependency, and bash_kernel won't install from src without this change.
I've tested this code in my environment but it freezes bash execution.
So it didn't help to fix #107 to me |
@hcz Thanks for testing. That's strange, as I get no hang here across a quite wide diversity of linuxes and bashes. does manually running |
@@ -105,9 +105,14 @@ def _start_bash(self): | |||
finally: | |||
signal.signal(signal.SIGINT, sig) | |||
|
|||
# Disable bracketed paste (see <https://github.com/takluyver/bash_kernel/issues/117>) | |||
self.bashwrapper.run_command("bind 'set enable-bracketed-paste off' >/dev/null 2>&1 || true") |
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.
@hcz and, do you get any output if you redirect this to some file rather than /dev/null? If you edit this file in a testing venv/conda env, perhaps try commenting out the line below (TERM_PROGRAM=...) to see if that's the cause.
@hcz how about the latest commit? does that hang still? (run I removed the part about TERM_PROGRAM, so this now should be identical to manually running |
@kdm9 thanks for the try, but unfortunately it doesn't hang and doesn't work |
@hcz thanks for testing! Now I'm really confused :)
Unless anything obvious is wrong in 1. above, I'll have to defer to @takluyver as to why kernel.run_command("XXX") behaves differently from running the identical command in the first cell. Best, |
|
@hcz Wonderful news! Thanks so much for testing, i'm glad it fixes it too. I'll amend the instructions above to ensure folks uninstall it if they want to test/use this version until @takluyver has time to review/merge. |
@takluyver a friendly ping about this PR. I'm teaching a workshop using jupyter & bash_kernel soon, and I'd much prefer the instructions to be If you need help maintaining bash_kernel, I'd be happy to step in as a co-maintainer, even if temporarily until you have more time. If so, just add me to the repo. |
As a cheap simple workaround, I found just unsetting my
|
Thanks @kdm9 et al for diagnosing and figuring out a fix for this, and sorry it's taken me so long to look at it. I think the fix basically looks good, and I'll merge it. If I was being picky, I might suggest that this belongs 'upstream' in pexpect (this file tries to set bash up for being wrapped in a programmatic interface), but there's a working fix ready here, and I'd probably also need to review the Pexpect PR (though there are other maintainers there), so let's not hold this up for that. Further in the future, I wonder if bash_kernel (or the pexpect replwrap API it uses) could make use of bracketed paste, rather than disabling it. Currently, if you have more than one line in a cell, bash_kernel sends them to bash one at a time, waiting for the prompt after each one. With bracketed paste, it should be possible to send the whole cell in one go. On the other hand, it probably doesn't simplify the code in replwrap unless we can assume that every REPL to be wrapped supports bracketed paste. 🤔 |
I've released version 0.8 with this change - hopefully that fixes a lot of the issues people have been seeing. |
This will automatically disable bracketed paste, which seems to break bash_kernel. I have verified that this fixes the problem with the latest released version of bash_kernel.
It should address issues described in #117, #116, & #115 (which are all the same AFAICT).
Additionally, I've added code to set the TERM_PROGRAM and TERM_PROGRAM_VERSION env vars so others can use this to perform customisation of bashrc as needed. This might not be ideal, as perhaps bashrc has executed before these are set. Please advise if that's the case.(removed this)To use this code: