alexdantas / acoc

Arbitrary Command Output Colourer
GNU General Public License v2.0
23 stars 1 forks source link

Add Support for Pipes #1

Open njwhite opened 10 years ago

njwhite commented 10 years ago

I'd ideally like the acoc to colour stdin if no command is given, e.g.: $ ls -l | acoc It'd be a bit more tricky to work out which set of rules to use (shells don't seem to tell a process in a pipe what the pid of the predecessor is, though this has some ideas). Maybe each process in the config could have regex that's used to determine if an arbitary output belongs to it?

alexdantas commented 10 years ago

Hey @njwhite, thanks for pointing that out! It'd really be great feature to add.

Unfortunately I'm kinda busy these days - oh yeah, also sorry for taking so long to answer you. I'll work on this asap, keeping you updated

alexdantas commented 10 years ago

This issue is being harder than I though. I tried to tackle it in one go but it was to no avail.

So I'm reformatting ACOC's code to make it easier to maintain and add new features. As I said before, the code's a mess and I still have to figure out a couple of things on the original author's mindset.

Just to keep track, @Stantheman gave me a great tip on Reddit: he made a perl script called fuse-colors.

On his words, it abuses a fuse filesystem and PATH to let you pre-mangle bash commands before being processed. Pipes and other normal shell characteristics aren't affected since it has access to everything before that processing takes place.

It's a nice place to start, along with your link.