Shell colors
  • Order of the Butterfly
    Order of the Butterfly
    Hawk
    Posts: 204 from 2003/12/29
    From: Tokyo - Japan
    Hello!

    I was wondering how to change the colors on Ambient's shell. I don't want to change them globally for all the apps... So, when I do an 'ls --color' I get some foreground colors are the same as the background... can't read!

    I like this shell:

    Morphos Live CD

    There is no shell manual?


    [ Edited by Hawk on 2004/10/10 15:31 ]

    [ Edited by Hawk on 2004/10/10 15:32 ]
    Pegasos II G3@600Mhz (no fan) 512MB RAM (1 slot)
    -- Maxtor 6Y120P0 120GB, 7200 rpm -- ATI Radeon 7500 - (64MB, TV-out)
    -- Minuet Slimline PC case -- MorphOS 1.4.5 + Gentoo
    EFIKA
  • »10.10.04 - 06:30
    Profile Visit Website
  • Leo
  • Order of the Butterfly
    Order of the Butterfly
    Leo
    Posts: 419 from 2003/8/18
    Quote:


    I was wondering how to change the colors on Ambient's shell. I don't want to change them globally for all the apps...


    You cannot change colors for a certain app only.
    As far as I know (someone: correct me if I'm wrong), you define your colors (from 0 to 7) in the file s:con.init - Programs can then set background and foreground colors to one of these colors (using ANSI escapes sequences).

    The problem is that very little (if none at all) Amiga/MorphOS shell commands make use of these colors.

    To change a color, either add the following line in s:con.init or use echo "line":

    [[0;255;120;30V

    0 = Color number
    255 = Red component
    120 = Green component
    30 = Blue coponent
    V close 'tag'

    To change display color, you would then use:
    [[32m

    where:
    3 = type of display
    2 = foreground color
    m closes 'tag'

    => background will be color 0 and foreground color will be set to color '2' in this example

    To reset the display to default style/color, you can use:

    [[0m

    There are other types of display where background color can be different than color 0, type can be bold, italic,...

    => These are standard ANSI escape chars

    Note: the first character '[[' is not simply two '[' it's an 'escape character', see the following file for example:

    http://nogfx.free.fr/morphos/con.init

    Quote:


    There is no shell manual?


    There's no manual. I already asked for more information about it but, guess what (:)), I received no answer.

    Anyway, hope this will help...
    If you need more information, just ask.

    Regards,
    Leo.

    PS: if you need some documentation of standard morphos commands, you may want to try the small "Help" program I'm writting. It only shows a small description of commands for now but can still be usefull: http://nogfx.free.fr/morphos/Help-Projectv01.lha

    [ Edited by Leo on 2004/10/10 9:34 ]
    Nothing hurts a project more than developers not taking the time to let their community know what is going on.
  • »10.10.04 - 10:22
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    DoctorMorbius_FP
    Posts: 315 from 2004/2/14
    From: Naples - Italy
    You can change colours any time you want. It is sufficient to type a command like this:

    Echo "*E[0;0;0;0V*E[1;220;220;220V*E[2;180;180;0V*E[3;80;208;248V
    *E[4;238;68;68V*E[5;85;220;85V*E[6;0;68;221V*E[7;238;153;0V*E[0J*E[1F"

    (This line is broken in two parts only for typographical reasons: you have to type it as a whole, without intermediate spaces.)

    Here *E generates the <ESC> code, the *E[...V commands set the colours, *E[0J clears the CLI window all below the current line, and *E[1F brings the cursor 1 line up and move it to the beginning of the line. The result is that you have new colours from the current line on.

    Since it is not practical to write each time a command line like the previous one, the best thing to do is to set it as an alias in the shell, or to save it as a script file in S:, assigning to it a very small name. Then you can execute the alias or the script just by typeing its name in the current shell window when you want. Of course you can have as many colour settings as you want, storing them in various aliases or script files that you can execute when you will need them.

    You can reset the shell colours any time you want, returning to the original settings, by using a bug in the current MorphOS shell. Just iconify the shell window and reopen it again.

    You can also find a documentation concerning all the (known) Amiga ANSI commands on Aminet, in the archive "dev/misc/AmigaANSI.txt". Just remember to read it with a text editor if you want to see the escape codes.
    Powered by PegasosII-G4, MacMini, PowerMac MDD.
  • »10.10.04 - 18:43
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Hawk
    Posts: 204 from 2003/12/29
    From: Tokyo - Japan
    Thank u!
    It worked! The con.init file didn't work, though. I used the "echo" approach and put it in SYS:S/shell-startup

    The help command is very useful! Thank u! By the way, what about "man"? It comes with morphos sdk, but then it complains about "less" command missing...
    Pegasos II G3@600Mhz (no fan) 512MB RAM (1 slot)
    -- Maxtor 6Y120P0 120GB, 7200 rpm -- ATI Radeon 7500 - (64MB, TV-out)
    -- Minuet Slimline PC case -- MorphOS 1.4.5 + Gentoo
    EFIKA
  • »11.10.04 - 03:23
    Profile Visit Website
  • Moderator
    hooligan
    Posts: 1948 from 2003/2/23
    From: Lahti, Finland
    The bad thing is that if you iconify and uniconify, the shell is grey again.
    I'd imagine this is fixed in 1.5 as it has MUI Shell.

    Some others have gotten their update... *cough* how about us? :-P
    www.mikseri.net/hooligan <- Free music
  • »11.10.04 - 05:22
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 62 from 2004/9/8
    From: France
    @DoctorMorbius_FP

    Your explanation is very interesting... I'll try
    PegasosII G4 512Mo 80Go ATI RADEON 9200SE....
    Yeah! The best it's MorphOS :)
  • »12.10.04 - 06:10
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Posts: 408 from 2004/7/15
    From: Russia, Moscow
    You can get less from Louise's site (unfortunately a little buggy). Or build it yourself :-)
    iPod, iBook, iMac,... iRobot?
  • »12.10.04 - 07:16
    Profile Visit Website