mabe02 / lanterna

Java library for creating text-based GUIs
GNU Lesser General Public License v3.0
2.23k stars 243 forks source link

Unable to use SGR codes in TextBox #506

Closed Martmists-GH closed 3 years ago

Martmists-GH commented 3 years ago

Using "Sample \u001b[30mText" as text inside a field shows up as Sample [30mText While I am aware of TextGraphics, this is not a great solution when you want to use a scrollable buffer of colored text.

(EDIT: Replaced \u009b with \u001b, it differs based on the source used, but neither work)

mabe02 commented 3 years ago

Unfortunately the text box components do not support colored text or any other escape codes. You'll have to create your own component to do that. I believe someone contributed (read-only) labels that can do this but no interactable components.