Open jjeffrey opened 2 years ago
Thanks for reporting @jjeffrey. nbterm relies on Rich for markdown rendering. I don't know if it's possible to configure it so that it wraps text. Do you want to look at it and open a PR? That would be great.
It does seem that euporie, which appears to also use Textualize/rich, has more accurate text wrapping on rendered Markdown cells.
Screenshot from euporie
:
I'm not sure if I'm the best person to look into it, but if I end up tinkering around and figuring out my problem, I'll try to make a PR.
I used rich to render markdown in euporie prior to v1.4.0
, but I now use my own renderer based on markdown-it-py
(so I can support tables, LaTeX, images, etc. in markdown).
To get rich to wrap the markdown, you'll need to set the max_width
on the rich Console
when rendering the output here. You can see how this was done in euporie here.
When editing a Markdown cell inside
nbterm
, I can insert line breaks so that the content fits on screen.However, when viewing a Markdown cell, text wrapping always cuts off a portion of the text, as long as it overflows. This is independent of the width of the terminal emulator: resizing it does not help.
On a related note, Markdown headers, which are center-aligned, are often cut off as well.
Using Gnome Terminal on Ubuntu 22.04, and Python 3.10.4.