[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: console fg & bg colours



These are the CSH aliases I use to set terminal colors. The mail program
probably will remove an embedded escape from these, you'll have to put it
back.
	
	Bruce

# Some csh versions don't support numeric escape sequences in echo.
set esc="\033"
if ( `echo $esc` == "\033" ) then
	# NOTE - THERE SHOULD BE AN EMBEDDED ESCAPE CHARACTER BETWEEN THE QUOTES
	# ON THE NEXT LINE.
	set esc=""
endif

# Clear the screen.
alias clear 'echo -n "${esc}[2J"'

# Set the color of the page behind the next characters that will
# be typed. Does not change the color of the overall background,
# just the part behind those characters.
alias page_black 'echo -n "${esc}[40m"'
alias page_blue 'echo -n "${esc}[44m"'
alias page_cyan 'echo -n "${esc}[46m"'
alias page_magenta 'echo -n "${esc}[45m"'
alias page_red 'echo -n "${esc}[41m"'
alias page_white 'echo -n "${esc}[47m"'
alias page_yellow 'echo -n "${esc}[42m"'
alias page_yellow 'echo -n "${esc}[43m"'

# Set the color of the next characters. This does not change the
# color of all type on the screen, only the next characters.
alias type_black 'echo -n "${esc}[30m"'
alias type_blue 'echo -n "${esc}[34m"'
alias type_bold 'echo -n "${esc}[1m"'
alias type_cyan 'echo -n "${esc}[36m"'
alias type_magenta 'echo -n "${esc}[35m"'
alias type_red 'echo -n "${esc}[31m"'
alias type_white 'echo -n "${esc}[37m"'
alias type_yellow 'echo -n "${esc}[32m"'

# Set the text attributes.
alias type_reset_to_default 'echo -n "${esc}[0m"'
alias type_disable_bold 'echo -n "${esc}[21m"'
alias type_disable_half_intensity 'echo -n "${esc}[22m"'
alias type_disable_italics 'echo -n "${esc}[23m"'
alias type_disable_reverse_video 'echo -n "${esc}[27m"'
alias type_disable_underline 'echo -n "${esc}[24m"'
alias type_half_intensity 'echo -n "${esc}[2m"'
alias type_italics 'echo -n "${esc}[3m"'
alias type_reverse_video 'echo -n "${esc}[7m"'
alias type_underline 'echo -n "${esc}[4m"'
--
Visit the "Toy Story" Web Page! http://www.toystory.com


Reply to: