Post BA32WBkm0CN9vVwCP2 by kboyd@phpc.social
(DIR) More posts by kboyd@phpc.social
(DIR) Post #BA31yUQg3k3C0FT9YO by fribbledom@mastodon.social
0 likes, 0 repeats
"Word wrapping is easy. Just count characters and split on spaces, right?"Sure.Until you account for Unicode grapheme clusters, terminal cell width, combining characters, ZWJ, emoji, CJK, tabs, ANSI sequences, OSC 8 hyperlinks, indentation, hard/soft breaks, unbreakable words, hyphenation, and trailing whitespace.And then a scrollbar enters the chat.Easy.
(DIR) Post #BA32WBkm0CN9vVwCP2 by kboyd@phpc.social
0 likes, 0 repeats
@fribbledom you forgot ... wrapping around images.
(DIR) Post #BA37CFgKBeam5aAaH2 by fribbledom@mastodon.social
0 likes, 0 repeats
@edolnx Don't worry, you're discovering the secret of terminal emulation: nobody actually understands any of it 🤣It's legacy hacks built on legacy hacks built on a workaround for a historical accident, with another workaround added because the first workaround became a de facto standard.You're probably doing great. Welcome to terminal development!
(DIR) Post #BA38n9PgYUoFJhXsfo by thomask@social.octet-stream.net
0 likes, 0 repeats
@fribbledom This definitely came up when I was researching newer UI frameworks. GTK and Qt are still pretty compelling when they have a good document text view out of the box.
(DIR) Post #BA3CC4v2hZ16Tpn4am by studio369@mas.to
0 likes, 0 repeats
@fribbledom wrap the words in a burrito and eat it
(DIR) Post #BA3f8HNUlPI921wcLI by Noxie@eldritch.cafe
0 likes, 0 repeats
@fribbledom and also some languages that have breaking exceptions like french, you don't break necessarily on the phœneme. For instance charette can be broken into cha-rette or charet-te (yes in the middle of the two t) but not char-ette because ette is a diminutive so no breaking it awayI have yet to find a single soft that breaks French correctly other than LaTeX.
(DIR) Post #BA3gCXObFf4pp43VOi by Noxie@eldritch.cafe
0 likes, 0 repeats
@fribbledom which itself was a hack because of teletypers which had hacks to replicate actual hammer printers that were used prior to widespread use of screens ... I mean there are some shells like nushell that are breaking away from the legacy, thus not being fully xterm compatible and tbh I feel it's the only way to go forward. From dash to bash to zsh, here too there's some cleanup to be had @edolnx
(DIR) Post #BA3uopPq6JBQ4amuSO by edavies@functional.cafe
0 likes, 0 repeats
@fribbledom Not to mention bidirectional text.
(DIR) Post #BA42zm51dtHgXvmbEO by TheConstructor@social.tchncs.de
0 likes, 0 repeats
@fribbledom and that's just the monospace fun. Oh and ligatures
(DIR) Post #BAFxlKiimMfztV649Y by Mr_Teatime@social.tchncs.de
0 likes, 0 repeats
@fribbledomOh dear, another world view shatzered. I expected that there'd be a decent choice of libraries to do word wrapping for you, in most relevant languages.... not that it's fundamentally solvable, what with long words, short lines, URLs, unbreakable spaces... but, you know, some reasonably-defined way to deal with those must exist in open source, no?@edolnx