batcmd - Separate stdout and stderr with syntax highlighting
A bashrc shell function that runs any command and displays stdout and stderr as separate streams with bat
syntax highlighting. Uses file descriptor swapping to cleanly separate the streams without temporary files or running the command twice.
Features:
- Configurable syntax highlighting language
- Clean separation with "STDOUT" and "STDERR" headers
- Works with any command
- No temporary files or command duplication
Example: batstreams cargo run
- Note that piped usage will work but stderr isn't captured, obviously (can still useful to see the STDOUT separately and with highlighting). If you need the STDERR too then use it before the command not after with a pipe