miniblog.

← Back to all posts
26
Do you have a favourite way of highlighting text in a CLI error message? Currently I'm using backticks, but I'm wondering what's the most readable.
PhotoPhoto

6 Comments

@wilfredh The underlined one jumps out most clearly to me without generating too much noise
@wilfredh italic for me, maybe backtick as a fallback for a dumb terminal. Underline is busy, colors may be hard to read if the defaults are bad.
@wilfredh If you believe that color and formatting should only be additive (accessibility principle) and that console output should survive copy/paste into a text editor and should work in basic terminal environments, I think backticks is the only valid option of what you showed. (But what’s wrong with double or single quotes?)
Hyperlinking to the source code in e.g. GitHub? That's an option for checked-in code I suppose. That said, I've only seen one Rust tool use hyperlinks in CLI output, and that's it. Have you see other tools use links in the wild? Did you like it?