bash_kernel icon indicating copy to clipboard operation
bash_kernel copied to clipboard

bash_kernel bug with readline > v8.0 in conda environments

Open CriticalSci opened this issue 4 years ago • 4 comments

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
Screenshot 2021-09-09 at 16 06 10

CriticalSci avatar Sep 09 '21 07:09 CriticalSci

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?

more info on bracketed paste

goekce avatar Oct 02 '21 14:10 goekce

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.

takluyver avatar Oct 05 '21 09:10 takluyver

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 avatar Nov 05 '21 09:11 CriticalSci

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.

ackalker avatar Feb 08 '22 15:02 ackalker

I think #120 should fix this.

takluyver avatar Aug 22 '22 10:08 takluyver