Say we want to show someone what we’re seeing in the terminal. A screenshot gives us full visual fidelity, but the text can’t be selected or inspected. This makes it harder to reproduce the situation, especially if any ambiguous characters (like 0 and O) are involved. Copying the text will lose the formatting, such as color. Formatted text to the rescue! You can copy and send an HTML snippet or file to get the best of both worlds.

For example, take this terminal window:

Terminal window

If you select the first line and use the context (or right–click) menu “Copy as HTML” option you get the following contents:


This page is a preview of The newline Guide to Bash Scripting

No discussions yet