5 ms·
I'd be happy if we could get terminals to agree on how wide the warning triangle emoji renders. The emoji are certainly useful for scripts, but often widths are
by mmastrac 1y ago
I'd be happy if we could get terminals to agree on how wide the warning triangle emoji renders. The emoji are certainly useful for scripts, but often widths are such a crapshoot. I cannot add width detection to every bash script I write for every emoji I want to use.
If only there was a standards body that could perhaps spec how these work in terminals.
- charcircuit 1y agoYou could ship a terminal with your script. This is how apps like Slack deal with inconsistent handling of standardized content by shipping an embedded chromium.
- liamkearney 1y agoWhat doesn’t justify shipping chromium these days?
- a5c11 1y agoSanity.
- dgl 1y agoThe ChromeOS terminal (hterm[1]) is actually a pretty good terminal, so even a terminal might justify a browser context. Blink[2] on iOS for example uses it. [1]: https://hterm.org/ https://hterm.org/ (although in the way they do Google seems to have lost interest in updating that site and the GitHub repo, there's still fixes in the upstream Chromium repo) [2]: https://blink.sh https://blink.sh
- notpushkin 1y agoHow does it compare to https://xtermjs.org/ https://xtermjs.org/?
- kergonath 1y agoYeah. Please don’t do that.
- utf_8x 1y agoOh god, please don't give them ideas
- noisy_boy 1y agoWhat a coincidence that I spent a good portion of time trying to deal with the warning triangle emoji and see your comment today. Incidentally the info and green ticks are not so bad. Wonder why that specific one has width issues.
- layer8 1y agoIt was traditionally often single-width in text representation, but double-width in emoji presentation: https://en.wikipedia.org/wiki/Emoji#Emoji_versus_text_presentation https://en.wikipedia.org/wiki/Emoji#Emoji_versus_text_presen...
- kps 1y agoAnd Unicode threw out all pretense of stability by retroactively changing some characters to default-emoji.
- a5c11 1y agoOr you could just rely on the ordinary, fixed-width font available in every terminal? I mean, what do you need emojis for in a bash script?
- kergonath 1y agoEmoji are good to highlight information. A red cross stands out in a list of green ticks much better than a [failed] among the [passed].
- gapan 1y ago> Emoji are good to highlight information. A red cross stands out in a list of green ticks much better than a [failed] among the [passed]. Rendering [failed] in red and [passed] in green would achieve the same. It's not emoji vs text. It's color vs no color.
- tetha 1y agoAnd shapes, though you can get that with some ASCII art as well. I've had a few scripts some time ago that took a long time to run, so I wanted a progress indicator I could see from across the room - that way I could play some guitar while monitoring the computer doing stuff in the evening. Hence, the log messages got prefixed with tags like: > ] >> ] # normal progress /!\/!\] # it had to engage in a workaround x_x ] # if it had to stop.
- kergonath 1y ago> Rendering [failed] in red and [passed] in green would achieve the same. It's not emoji vs text. It's color vs no color. True, but my prompt is full of colour ASCII characters so emoji stand out. And also, emoji fare better than escape codes when they pass through pipes and stuff.
- thaumasiotes 1y ago> True, but my prompt is full of colour ASCII characters so emoji stand out. Huh? How often does your prompt appear inside the output you're reading?
- twic 1y agoUntil then, as it happens, an old colleague of mine is working on a JS library to paper over the cracks: https://github.com/davidje13/tty-typesetter https://github.com/davidje13/tty-typesetter I haven't used it in anger so can't vouch for it!