ansi2html
is a much better solution. Why didn't I think of it before 😅🤷♂️?
- Tested on macOS but should work on Linux.
- Requires Node.js (any recent version will do).
- Put
package.json
andconvert.js
in the same dir, and runnpm i
there. - In macOS Terminal, run shell command and redirect its stdout or stderr to a file, e.g.
gls --color ~/Documents > gls-output.txt
. - Run
node convert gls-output.txt
. - Open
out.html
in your browser.