2

I'm trying to figure out how to get various commands (such as touch, git, or echo to display a different color in the terminal. I installed the Dracula theme but the instance of it on my computer does not look the same, save for the background, text, and directory color. I have tried to install a few other themes where I have seen photos of command text displayed in a different color, but none of them work for some reason.

I'm on mac os sierra running the latest version of terminal. I also have have the display of ANSI colors enabled. I would really love to get this to work, as it would allow me to interpret my console more efficiently.

1
  • For basics, take a look here: owsiak.org/?p=3338 I also suggest to watch this one - if you want to accelerate your productivity in shell (from time to time they have nice discounts) - owsiak.org/?p=2177 Commented Jun 30, 2017 at 6:22

1 Answer 1

1

You can use tput command to assign color values to variables and use them in your output, like in below example:

GREEN=$(tput setaf 2)
RESET=$(tput sgr0)
echo ${GREEN}"HELLO WORLD"${RESET}

You can change the value of setaf for different colors

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.