|
|
|
|
|
by petercooper
5179 days ago
|
|
I'm sure someone here will know the answer for this off the top of their head so.. how does this work under the hood? How does it get to act as a sort of 'filter' for stdout? I've recently seen a system that can 'record' your terminal session for replay on the Web - http://ascii.io/ - whose 'recorder' forks off a psuedo terminal for this (https://github.com/sickill/ascii.io-cli/blob/master/bin/asci...). Would something like Grc use a similar approach or is there another way? |
|
1. export your real $PATH to eg $REAL_PATH
2. clear $PATH (or set it to some dummy value)
3. Attach a wrapper script to command_not_found_handler, which would call the original command with REAL_PATH and pipes it to your filter (or colorizer or whatever).