Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In the fish shell, the actual command line is syntax highlighted:

enter image description here

Is there any way to get this same behavior in bash?

There is something just like this but for zsh, not bash. Is it possible that this could be ported to bash?

To clarify for those who don't understand the screenshot, explanation, or link provided: I want to highlight the actual text that is entered at the terminal. The commands, parentheses, quotes, etc.

share|improve this question
Don't think bash accepts plugins like zsh does, so it may require a custom build of the bash shell/binary. Any reason not to just use fish instead? Also, thanks for pointing me to another shell to play around with and see if I can learn some advanced features of haha. – Matrix Mole Jul 11 '11 at 1:47
@Matrix: I can't use fish because I have a very complex bash configuration that I couldn't give up. – Wuffers Jul 11 '11 at 1:54
I completely understand on complex configurations, and wish you luck in your search. – Matrix Mole Jul 11 '11 at 2:05
Unfortunately, I don't think that this is currently possible in bash. I'm sure that the research that you've done points to that as well. If you absolutely cannot switch to zsh, then that's understandable, but otherwise you may want to look at fizsh which incorporates some fish-like features into zsh, although it hasn't been updated since February, so perhaps the zsh-syntax-highlighting link that you provided would be more robust. – voithos Jul 19 '11 at 18:34

1 Answer

I dont think syntax highlighting should happen at the shell level but at the interface level (just my opinion -and someone else's it seems-), so I would look into "plugins" for Terminal or your favorite console, for example this plug in for Kate might help, or this other one which offers syntax highlighting in nano

Here is still more talk about how to syntax highlighting in Terminal:

Add alias ls='ls -G' to .bash_profile.

although here is better explained the how to

Hope it helps

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.