It's unfortunate that '# foo' can mean "here's a command you need to run as root" or can mean "here's a comment about the next command". It's a recipe for confusion.
Related Posts
I would *love* a terminal emulator that treated each command as an atomic unit, so I can efficiently scroll between them.
Line-based scrolling is annoying when you've just run a command that output 1,000 lines.
Do any such tools exist?
In praise of Tcl, and reflecting on syntax features for a good command shell: https://yosefk.com/blog/i-cant-believe-im-praising-tcl.html
It is remarkably hard to escape command line arguments safely on Windows, and the standard libraries of multiple languages have needed patching: https://flatt.tech/research/posts/batbadbut-you-cant-securely-execute-commands-on-windows/