3

I like using the default terminal application, but as I use both Ubuntu and OS X a lot I want to make them behave and look the same. How can I change the Mac terminal to make as identical as possible to the Ubuntu terminal?

edit: A similar post Can I make my Mac OS X Terminal color items according to syntax, like the Ubuntu terminal? does not answer my question for the following reasons:

  • It does not tell me what background color Ubuntu uses or if the colors given are the default colors that Ubuntu uses.
  • Gives me a multi line command prompt (I really prefer the single line prompt)
  • It talks about syntax highlighting I am interested in other changes as well such as copying and pasting behavior.
  • Does not properly explain how export PS1="\n$C_LIGHTGREEN\u$C_DARKGRAY@$C_BLUE\h $C_DARKGRAY: $C_LIGHTYELLOW\w\n$C_DARKGRAY\$$C_DEFAULT functions.
    • From what I can tell in changes the prompt so that newline is light green, user appears next in dark gray and blue(?), host name appears in darkgrey, something else is light yellow(?), current working directory is darkgray and a newline is made (?) $(or # for root) is a default color.
    • Looking at this website asnwers a bit of my question.
4
  • 2
  • I saw that but it does not answer several questions like what are the colors used by Ubuntu. I do not just what syntax highlighting enabled. I want it to be nearly identical. Also do not have enough reputation to make a comment on that post.
    – AzJ
    Commented Jun 6, 2016 at 15:02
  • Then edit your own question, link to that post including salient points, & make your question 'the rest of what you need to know'
    – Tetsujin
    Commented Jun 6, 2016 at 17:06
  • @Tetsujin I hope my new edit has made things easier to understand. Thanks for the suggestion.
    – AzJ
    Commented Jun 6, 2016 at 19:48

2 Answers 2

2

You'll need to change the shell settings to match your current Ubuntu terminal. Simple way would be to make your local .bashrc match the one used by Ubuntu (see here for an example of the Ubuntu default .bashrc.) You can either plug the settings in to a .bashrc file for all shells, or use a .bash_profile in your home folder to set Terminal preferences for login shells. This post has more details on how to create these files.

Last, I imagine your Ubuntu terminal sessions aren't on a white screen - Adding in the xterm-color settings will provide colored text, but won't affect the background color. I generally start by making the "Homebrew" Terminal display setting the default in OS X, to get black background + green text, then tweak from there.

Poke around in the other settings you have for yourself on Ubuntu - any default keyboard shortcuts, etc. will be in .profile or .bash_profile, and those can be copied into the same folder on your Mac. If you want to get really picky you can even install Ubuntu Mono (the default Ubuntu terminal font) on your Mac, and use it as the default font for Terminal.

0

I believe the previous answer doesn't help in ls coloring. Because ls uses dircolors -b on Ubuntu to generate the color codes, and the output of that utility doesn't work for Mac at all.

I have posted my take to get as close to Ubuntu colors (as of 2023) as it gets on Mac in a parallel thread.

1
  • It’s better to post the key points of the answer here (even if it’s yours) so the user doesn’t have to jump around to get the info and this answer directly addresses the question here.
    – Allan
    Commented Feb 22, 2023 at 14:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .