6

I'm using Gnome Terminal. All my input have the same color.

But today I was using Powershell in Windows and it has different colors for a command, for flags and for options.

How I can do the same in Ubuntu? I have tried themes, but they only change the background but not my input.

(I took image from internet, so pay attention only to upper selection) enter image description here

UPD. I want to have colors when I write command. For example when I write git commit -m "Hello" - git should be yellow, commit white, -m grey and "Hello" green.

  • 1
    What exactly do you want it to do? Please be more specific. – derHugo Nov 8 '17 at 19:20
  • 1
    I want to have colors when I write command. For example when I write git commit -m "Hello" - git should be yellow, commit white -m grey and "Hello" green. – EnverOsmanov Nov 8 '17 at 19:27
  • 3
    This is called syntax highlighting. Recent versions of IPython support it, but I'm not sure how to get it in Bash. – wjandrea Nov 8 '17 at 19:28
  • 5
    Not bash, but fish will - hackercodex.com/guide/install-fish-shell-mac-ubuntu or similar – Panther Nov 8 '17 at 20:17
  • 2
    Switching shells is the quickest way to get it. Zsh or fish, maybe – muru Nov 9 '17 at 15:36
5

Bash (the default shell of Ubuntu) doesn't have this ability. It uses GNU readline, and likely would be a serious effort to implement it.

But, there are mechanisms to use different shells. Two common ones that are talked about a lot are:

  • oh-my-zsh - "Your terminal never felt this good before.
  • fish - "A command line shell for the 90s"

See the respective sites for up to date setup instructions. But in general the shells are not that hard to configure. Fish, for instance is:

sudo apt install fish
chsh -s /usr/bin/fish
# logout/login

Then, if you want to switch back

chsh -s /bin/bash
# logout/login

oh-my-zsh isn't as easy, but it's the same idea.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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