I try to limit how many annoyances I carry around with me. They’re not good for my wellbeing. But one I cannot shake is when developer documentation prepends a $ or > charater to a code snippet in order to indicate a terminal command.

As an example, here is the command to run a development version of this website.

$ npm run dev

The problem here is when I go to copy the text, I need to specifically avoid including the $ character. Otherwise, I’ll just get the error zsh: command not found: $.

This gets especially annoying with GitHub markdown which helpfully generates a “copy text” button. This button is intended to make it easier to copy codeblocks, but when the $ is included, it’s rendered useless.

It should be clear from context that the command in a codeblock is intended to run on a terminal. Just omit the $. It will be fine.