문제

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.

도움이 되었습니까?

해결책

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/ ).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top