Most active commenters
  • kergonath(5)
  • noisy_boy(3)

←back to thread

178 points dgl | 24 comments | | HN request time: 1.081s | source | bottom
1. mmastrac ◴[] No.44362863[source]
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.

replies(4): >>44362918 #>>44363071 #>>44363211 #>>44369636 #
2. charcircuit ◴[] No.44362918[source]
You 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.
replies(3): >>44363122 #>>44363344 #>>44363554 #
3. noisy_boy ◴[] No.44363071[source]
What 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.
replies(1): >>44365521 #
4. liamkearney ◴[] No.44363122[source]
What doesn’t justify shipping chromium these days?
replies(2): >>44363210 #>>44363218 #
5. dgl ◴[] No.44363210{3}[source]
The 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/ (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

replies(1): >>44363320 #
6. a5c11 ◴[] No.44363211[source]
Or 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?
replies(2): >>44363238 #>>44363336 #
7. a5c11 ◴[] No.44363218{3}[source]
Sanity.
8. warkdarrior ◴[] No.44363238[source]
And, frankly, why even bother with lower-case characters? Upper case is plenty good -- it was good enough for the VT05, it should be good enough for your laptop.
9. notpushkin ◴[] No.44363320{4}[source]
How does it compare to https://xtermjs.org/?
10. kergonath ◴[] No.44363336[source]
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].
replies(2): >>44363431 #>>44366339 #
11. kergonath ◴[] No.44363344[source]
Yeah. Please don’t do that.
12. gapan ◴[] No.44363431{3}[source]
> 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.

replies(3): >>44363812 #>>44364208 #>>44402995 #
13. utf_8x ◴[] No.44363554[source]
Oh god, please don't give them ideas
14. tetha ◴[] No.44363812{4}[source]
And 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.
15. kergonath ◴[] No.44364208{4}[source]
> 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.

replies(1): >>44367477 #
16. layer8 ◴[] No.44365521[source]
It was traditionally often single-width in text representation, but double-width in emoji presentation: https://en.wikipedia.org/wiki/Emoji#Emoji_versus_text_presen...
replies(1): >>44366359 #
17. kps ◴[] No.44366339{3}[source]
And then I have to guess which unicode cross this particular tool picked so I can search for it in log.
replies(1): >>44369082 #
18. kps ◴[] No.44366359{3}[source]
And Unicode threw out all pretense of stability by retroactively changing some characters to default-emoji.
19. thaumasiotes ◴[] No.44367477{5}[source]
> 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?

replies(1): >>44369076 #
20. kergonath ◴[] No.44369076{6}[source]
Every time I grep something. True, it’s not a major issue, but we are talking about preferences here.
21. kergonath ◴[] No.44369082{4}[source]
Emojis are for me. The grep-able stuff comes afterwards, in ASCII.
replies(1): >>44402997 #
22. twic ◴[] No.44369636[source]
Until 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

I haven't used it in anger so can't vouch for it!

23. noisy_boy ◴[] No.44402995{4}[source]
> Rendering [failed] in red and [passed] in green would achieve the same. It's not emoji vs text. It's color vs no color.

Thats only true for the terminal. When the same output is saved to a file or viewed via a non-terminal interface, the colors won't always be retained but the text/icons will be. E.g. in Jenkins console logs, you need to enable ASCII coloring explicitly to be able to see colored text.

24. noisy_boy ◴[] No.44402997{5}[source]
Doesn't even have to be mutually exclusive - with log format including log level, you can get the best of both worlds.