You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I'm using rich==13.5.2, python 3.10, and when trying to print syntax highlighted code in Jupyter, I'm getting trailing whitespaces which makes it inconvenient to copy, see image below:
My desired outcome is for the trailing whitespaces to not exist.
I came across this issue while trying to fix this problem, #2647 , but the suggested solution there (WhitespaceStrippingConsole didn't work for me), here is my attempt anyway:
(I had to modify it a little because each line ending wasn't \n, it was \x1b[0m.
But it doesn't work, there are still trailing whitespaces as seen from the image above. I'm sure that the monkey-patched _render_buffer() function is actually running, and that the final to_render string does NOT have trailing whitespace, but yet when rendered in Jupyter the whitespaces still exist.
Can anyone provide any guidance or assistance, it would be much appreciated. Thanks!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there, I'm using
rich==13.5.2
, python 3.10, and when trying to print syntax highlighted code in Jupyter, I'm getting trailing whitespaces which makes it inconvenient to copy, see image below:My desired outcome is for the trailing whitespaces to not exist.
I came across this issue while trying to fix this problem, #2647 , but the suggested solution there (
WhitespaceStrippingConsole
didn't work for me), here is my attempt anyway:(I had to modify it a little because each line ending wasn't
\n
, it was\x1b[0m
.But it doesn't work, there are still trailing whitespaces as seen from the image above. I'm sure that the monkey-patched
_render_buffer()
function is actually running, and that the finalto_render
string does NOT have trailing whitespace, but yet when rendered in Jupyter the whitespaces still exist.Can anyone provide any guidance or assistance, it would be much appreciated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions