Calysto / metakernel

Jupyter/IPython Kernel Tools
BSD 3-Clause "New" or "Revised" License
344 stars 84 forks source link

Strip paste-bracketing control characters #250

Closed anewusername closed 2 years ago

anewusername commented 2 years ago

This fixes downstream https://github.com/blink1073/oct2py/issues/237 and https://github.com/blink1073/oct2py/issues/248 as well as addressing the cause behind #228 .

The rationale is complicated somewhat by the fact that python disabled bracketed paste mode soon after #228, so that test doesn't fail anymore. I added a test that would fail without stripping the bracketing, by explicitly enabling it.

I think this is still the right place for this code (rather than downstream), since the readline default is to include the control characters, so I expect that stripping them will be common across multiple REPLs (including some bash invocations).

QuLogic commented 2 years ago

I thought this might also have fixed https://github.com/Calysto/octave_kernel/issues/215, but it doesn't seem like it did? Should something else be done here, or should a similar change be applied to octave_kernel?

blink1073 commented 2 years ago

Octave kernel is using run_command, so there shouldn't be anything extra to do there. I don't have Fedora set up to verify.

QuLogic commented 2 years ago

Unfortunately not, using metakernel 0.29.2, then https://github.com/Calysto/octave_kernel/issues/215 is not fixed.