[comp.sys.amiga] Fun with prompts!

bmacintyre@watsol.waterloo.edu (Blair MacIntyre) (11/25/88)

Something neat I discovered and thought I'd pass on ...

If you look in the sample shell.startup in the 1.3 S: dir, there are
2 aliases specified ... reverse and normal ... which change the screen
to white and back to blue ( assuming normal colours )


For people that know what is going on, this is not too exciting.  But,
for those that doen't, looking at how these work is worthwhile.  You
will discover that what they are doing is sending console escape sequences
to set the forground and backgroud pen to the appropriate colours.

What this is leading to are the neat possibilities this opens up.  For
example, try using these to make your prompt more attractive:

  prompt "*E[33m[*E[31m%S*[33m]*E31m >"

( I did that from memory and toned it down a bit ... mine has the 
  directory in it too! )

I thought this was neat food for thought ... I'm going to try to whip up
a little program to do something more interesting!  

Bye for now.

Blair
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
= Blair MacIntyre (bmacintyre@watsol.waterloo.edu)  The Guy in Green ...      =
= "Don't be mean ... remember, no matter where you go, there you are." BBanzai=
= "Don't wurry, be habby ..."                                                 =

jdow@gryphon.COM (J. Dow) (11/28/88)

In article <9980@watdragon.waterloo.edu> bmacintyre@watsol.waterloo.edu (Blair MacIntyre) writes:
>Something neat I discovered and thought I'd pass on ...
>
>If you look in the sample shell.startup in the 1.3 S: dir, there are
>2 aliases specified ... reverse and normal ... which change the screen
>to white and back to blue ( assuming normal colours )
>
>  prompt "*E[33m[*E[31m%S*[33m]*E31m >"
>
Ah well, podnah how about trying this one?
"prompt "*E[43m{@_@} %N*E[42m%c*E[0m*N*E[42m %g*E[0m "
I use that'n with wshell. It works just fine. (Actually I have the *E's replaced
with actual escape characters in my script that starts this whole mess...)

Me do something silly? Moi!

-- 
Sometimes a bird in the hand leaves a sticky deposit.
Perhaps it were best it remain there in the bush with the other one.

{@_@}
	jdow@bix (where else?)		Sometimes the dragon wins. Sometimes
	jdow@gryphon.CTS.COM		the knight. Does the fair maiden ever
	{backbone}!gryphon!jdow		win? Surely both the knight and dragon
					stink. Maybe the maiden should suicide?
					Better yet - she should get an Amiga and					quit playing with dragons and knights.

cg@myrias.UUCP (Chris Gray) (11/29/88)

In article <9980@watdragon.waterloo.edu> bmacintyre@watsol.waterloo.edu (Blair MacIntyre) writes:
>
>What this is leading to are the neat possibilities this opens up.  For
>example, try using these to make your prompt more attractive:
>
>  prompt "*E[33m[*E[31m%S*[33m]*E31m >"
>
>( I did that from memory and toned it down a bit ... mine has the 
>  directory in it too! )
>
I leave the current directory in mine. With my regular palette, that turns
the prompt into blue (same as the cursor) on a grey background.

Another useful set of aliases is to use the "lformat" option on 'eval' to
make commands that do conversions to/from hex,octal,decimal and ASCII. I
don't remember the details, but they go something like:

    alias hex eval {} lformat="%X8*N"
    alias octal eval {} lformat="%O9*N"
    alias char eval {} lformat="'%C'*N"

Unfortunately, only one field-width digit is allowed, so the octal one won't
print a 32 bit value. Also, make 'eval' resident for good response. I was
happily surprised to find that 'A' is a valid integer for 'eval'.

-- 
Chris Gray		Myrias Research, Edmonton	+1 403 428 1616
	{uunet!mnetor,ubc-vision,watmath,vax135}!alberta!myrias!cg