Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Development and Darwin (http://www.mac-forums.com/forums/os-x-development-darwin/)
-   -   Color your Mac Terminal? (http://www.mac-forums.com/forums/os-x-development-darwin/55717-color-your-mac-terminal.html)

DoubleCap 03-08-2007 02:32 AM

Color your Mac Terminal?
 
Hi, is there a tool that will color the mac terminal? I don't mean the regular change color of the font displayed, but something that will give a look like this: http://www.redhat.com/img/colored_prompt.png ?

caribiner23 03-08-2007 09:15 AM

Did you try the Preferences in Terminal?

Terminal --> Window Settings... -> Color

RiDE 03-08-2007 09:34 AM

Caribiner23 is corect, and if you would like those settings to stay after closing the terminal you need to click "Use as Default".

DoubleCap 03-08-2007 10:05 AM

Quote:

Originally Posted by stonecold (Post 343766)
Hi, is there a tool that will color the mac terminal? I don't mean the regular change color of the font displayed, but something that will give a look like this: http://www.redhat.com/img/colored_prompt.png ?

No, I know about that already. Did you go to the link I posted? Something that will have a different color for the, let's say, prompt, something different for the actual line you're typing, etc...

cradom 03-08-2007 10:20 AM

http://www.dotfiles.com/index.php?app_id=3

Various bash startup files. Colored prompts and more.

RiDE 03-08-2007 10:44 AM

This may help as well: http://sos.blog-city.com/mac_os_x__b...ttle_color.htm

DoubleCap 03-08-2007 04:08 PM

Thanks so far.

What do I do? How do I get these running?

cazabam 03-08-2007 04:20 PM

A quick google for 'bash prompt colour' brings back loads of tutorials and references. It's exactly the same for OS X as it is for just about any flavour of Linux or BSD :)

voiceofra 03-08-2007 04:31 PM

open terminal
make sure you're in your home directory
open .profile with your favorite terminal editor (I'ma vi or nano kinda guy)
add alias ls = "ls -G".

DoubleCap 03-09-2007 11:58 AM

I'm in my home directory, and I type in "nano .profile" but nothing shows up.. only a blank text editor.

cradom 03-09-2007 11:58 PM

Thats because it's not there by default. Try the following:
Copy this:

# ~/.bashrc: executed by bash(1) for non-login shells.

export PS1='\u@\h:\w$ '
umask 022

##########################################
#setting up file completion
#

if [ -f ~/.bash_completion ];
then
. ~/.bash_completion;
fi


############################################
# You may uncomment the following lines if you want 'ls' to be colorized:
#

export CLICOLOR='true'
export LSCOLORS="gxfxcxdxbxegedabagacad"

###########################################
# set up aliases
#

alias ll='ls -laghF'
alias l='ls -laghF'
alias grep='grep -n'
alias netconns='netstat -a -f inet'
alias cd..='cd ..'
alias ..='cd ..'
alias cls='clear'
# alias vi='vim'
# alias c++='g++'
# alias cc='gcc'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'
alias ttop='top -ocpu -R -F -s 2 -n30'


Now type "pico .bashrc" (or you can use nano) without the quotes.
Paste the above into it.
Save. Quit and restart Terminal.
Your files and directories should now be in color.

You can set different colored prompts by using escape characters. Just add the codes to .bashrc. I use the one called "bash_styles". It lets you change prompts on the fly without having to restart Terminal.


All times are GMT -4. The time now is 05:30 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.