How to screenshot Bash code properly: what Bash snippets actually look like, how auto-detection behaves, the theme that reads best, and the settings that keep the card legible.
Terminal content, which is the most genre-mixed of the ten: a shebang and set -euo pipefail at the top, if [ -z "$1" ]; then conditionals, $(…) command substitution, heredocs (<<'EOF'), curl invocations with a dozen flags and line continuations (\), and often the command's output pasted underneath. Variables ($HOME, ${var:-default}) are the language's whole identity, and they are also what makes rendering tricky: ${…} nests braces, quotes and $ in one token.
This is the weakest detection of the ten, and it is structural: the shell rule is last in the array (17), behind JSON and YAML. It fires on a #!/bin/sh-style shebang, echo $, or a line starting with apt, curl, cd, mkdir, or export. Notice what is not a trigger: if, then, for, while, ls, grep, sed, cat, printf, and #!/usr/bin/env bash with spaces. A script starting set -e and if [ … ] therefore falls through to the typescript default and gets coloured as TypeScript — braces and all. The same rule's triggers also misfire on prose ("curl the endpoint"), so a snippet of documentation can be typed as shell.
night-owl for dark, because it was designed for terminal palettes and its string colour survives the long quoted flags in a curl line. github-light for documentation cards; shell in a README should look like the rest of the README.
language: "shell" on every Bash card without exception — the slug is shell, not bash, and auto will get it wrong more often than right.curl \ broken across four lines with the backslashes intact is more honest than a reflowed command nobody can paste.language: "text", since a mixed card highlights the output as if it were code.Feature by feature, against the other code screenshot tools.