bash_kernel
bash_kernel copied to clipboard
bash_kernel bug with readline > v8.0 in conda environments
When accessing this kernel in a conda environment containing readline v8.1 (as is the default in conda-forge or defaults channels) every command output returns garbled with exit status 1 in the Jupyter notebook.
Only readline v8 (the default in the anaconda channel) restores normal behaviour.
Note the Jupyter lab server is also running nb_conda_kernels to access kernels across conda environments.
Can anyone advise what could be the problem here? Is there something in readline 8.1 breaking the code? Or is this specific to my setup?
The problematic environment configuration arises with anything other than anaconda as top priority channel:
conda create --name dev_bash bash ipykernel bash_kernel
could be related to https://github.com/takluyver/bash_kernel/issues/107
try with
bind 'set enable-bracketed-paste off'
Does someone know why this problem exists in bash_kernel?
That does look like it might be related to bracketed paste. At a guess, bash is sending the escape codes to switch bracketed paste mode on & off, but Jupyter's limited terminal emulation doesn't support them, so they both show up and interfere with checking exit codes.
Disabling bracketed paste mode is probably a good idea. With bash_kernel, you can't paste anything directly into the bash session anyway (it's running behind the Jupyter machinery), so there's no need for it. I think the right place to fix it is this file in pexpect, if anyone wants to make a PR.
could be related to #107
try with
bind 'set enable-bracketed-paste off'
Thanks, this does fix the problem (temporarily) for the duration of each session!
could be related to #107 try with
bind 'set enable-bracketed-paste off'Thanks, this does fix the problem (temporarily) for the duration of each session!
@CriticalSci Please see my comment in https://github.com/takluyver/bash_kernel/issues/117#issue-1127353493 for a hack that could help the workaround to 'stick' for all Bash kernel notebooks.
I think #120 should fix this.