Question

I like the idea of command prompt coloring, and I was wondering how I can extend that to have the shell color the commands as I type it in or via tab completion. So for example, when I finish typing 'gcc', the shell should recognize that it is a valid command and color it green. If the command is not a recognized command then it should be colored in red and boldfaced.

This feature will help tremendously in typing in correct commands especially if you have long commandlines with pipelined commands which accidentally contain a typo. All command typos will be colored red and boldfaced so that I can easily identify which command I typed incorrectly.

Was it helpful?

Solution

I'm not sure that you can do this in bash. But it is possible in other shells, e.g. in zsh (see: https://github.com/zsh-users/zsh-syntax-highlighting ) or in fish (see: http://fishshell.com/ ).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top