spago icon indicating copy to clipboard operation
spago copied to clipboard

Option to opt out of CLI emoji via spago.yaml, env var, and/or flag

Open toastal opened this issue 5 months ago • 9 comments

I appreciate the effort & whimsy put into selecting + supporting emojis, and I like them on websites & in chats, & I can get down with ASCII art or Kaomoji (。•̀ᴗ-)✧ or general Unicode, I however find emoji in terminal output with its bright colors and solid fills distracting in the visual hierarchy for both TUI workflows & reading my logs; it’s too much. Emoji will also appear broken in TTYs, other environments, & cases where the system emoji doesn’t support the chose symbol.

Considering there’s a way to opt out of color, I would like to opt out of emoji.

Yarn v1 (JS) uses yarn --no-emoji or in the RC file { ..., emoji: false }. Homebrew for macOS uses HOMEBREW_NO_EMOJI=1. Babel (JS) & Ember (JS) ended up removing their emoji support from CLI altogether.

toastal avatar Jan 27 '24 09:01 toastal

The emojis are not for cuteness, but for clarity of display - I put them there to grab attention in key parts of the build, e.g. see here, they appear (1) when selecting the package to build and (2) when the build is done:

image

So the idea is exactly what you are mentioning, to get your attention while you read logs. I personally find they look great on my terminal, but YMMV as other OSs have different emoji packs.

This is all to say that while I'm not happy about adding yet another flag, I'm up for swapping them out if we find another way of grabbing attention in the same way.

I guess we could just disable them when --no-color is passed? This would solve the issue of them being broken on TTYs as well, since we default to no-color there.

f-f avatar Jan 27 '24 09:01 f-f

Eh. These are separate issues. A terminal emulator can display colors just fine yet still have issues with the weird sizing of emoji—such as Kitty that, for performance, breaks the terminal into a grid based on the sizing of the configured monospace font which rarely aligns with dimensions of the emoji font. This also doesn’t address that while some folks find them helpful for getting a bearing on the output, others find them more distracting than helpful (color & indentation are already doing this).

toastal ไข่ดาว | https://toast.al PGP: 7944 74b7 d236 dab9 c9ef e7f9 5cce 6f14 66d4 7c9e

toastal avatar Jan 27 '24 10:01 toastal

The screenshot above is from Kitty FWIW

f-f avatar Jan 27 '24 11:01 f-f

Also kitty: Screenshot_20240127_190027

toastal avatar Jan 27 '24 12:01 toastal

Screenshot_20240127_191134

…And moments later I ran into where things no longer line up. It’s supposed to be a single character.

toastal avatar Jan 27 '24 12:01 toastal

Ah indeed that doesn't look good. The only emojis that we use are ❌ and ✅ and ⚠️, we can switch them out for equivalent Unicode symbols if we can find ones that approximate these well.

f-f avatar Feb 02 '24 13:02 f-f

To be fair, these specific symbols aren’t half bad as they generally match your text color whereas some CLIs get way too heavy-handed to the point where significant time is spent forcing emoji since everything has to have an emoji now …which Spago isn’t doing. Unicode won’t run in the TTY still since it’s locked to ASCII :(, but an incomplete list of non-emoji Unicode options could be:

Checkmarks: Warnings: ! Failures: 🕱

toastal avatar Feb 02 '24 14:02 toastal

Cool, we can go for , and , and skip them if we are running with no-color (since TTY won't support that either)

f-f avatar Feb 03 '24 10:02 f-f

In the TTY you will get a Unicode tofu block, but usually sans the the hex code inside it. You could argue that it could function as a bullet point of sorts which might make it clearer & then not have to concern yourself with an indentation change for no-color.

toastal avatar Feb 03 '24 13:02 toastal