[GRASS-dev] Custom GRASS command line prompt

Hamish hamish_b at yahoo.com
Sun Jul 28 15:10:50 PDT 2013


Nikos:
> Just a thought: would be nice to customise as to have a top or a
> bottom "info-line", or two "info-lines" below 80 chars (what's the
> max that should be respected?),

see MarkusN's "[Raster MASK present]" command prompt magic using

"$PROMPT_COMMAND" (set in $GISBASE/etc/Init.sh).

> or stuff can go in the terminals title-bar -- this, I
> guess, works easily with a few terminals like xterm.

see $GISBASE/etc/grass-run.sh


re. using terminal colors, a web-search finds a number of pages like this:
http://superuser.com/questions/270214/how-can-i-change-the-colors-of-my-xterm-using-ansi-escape-sequences
# putting that into practice:
CLEAR='\e[2J\e[1;1H'
FG_CYAN='\e[36m'
BG_BLUE='\e[44m'

echo -en "${FG_CYAN}${BG_BLUE}$CLEAR"


# example of adding an RGB border color with a #RRGGBB code:
echo -ne "\033]11;#53186f\007"

for me, xfce4-terminal and rxvt accepted the old EGA colors for fore/background,
but not the full RGB border -- I had to use xterm to see that work. 

But I think changing the border with a RGB color per mapset or location would
scale better if you were having a different color for each mapset/location. 
Or, for the "MASK present" I'd prefer a red terminal border to the extra line
on the command prompt, so it might be nice to search out what the different
escape codes for gnome-terminal et al. might be.


Hamish



More information about the grass-dev mailing list