prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.37k stars 716 forks source link

Can I make bottom toolbars where words wrap to multiple lines? #1068

Open wesleykendall opened 4 years ago

wesleykendall commented 4 years ago

The bottom toolbar was updated to break up multi-line strings across multiple lines of the bottom toolbar (https://github.com/prompt-toolkit/python-prompt-toolkit/issues/587). Is it possible for me to have a FormattedText object (like HTML) that has a really long piece of text that wraps across multiple lines? Currently a really long string just gets chopped off.

If it's not possible for it to automatically wrap, is there a way for me to dynamically render the text and insert line breaks in the bottom toolbar based on the character width of the terminal?

Thanks for your help! This library is incredible

jonathanslenders commented 4 years ago

I think we have to set wrap_lines=True in the `Window that wraps the bottom toolbar in shortcuts/prompt.py (around line 551). I'm not sure whether there's a chance this could break something, I have to think about that.

Remember that in case of line wrapping, we possibly break at any character right now, not just between words.