Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: Xanxi on April 01, 2011, 06:00:21 PM

Title: How to have a black and white CLI?
Post by: Xanxi on April 01, 2011, 06:00:21 PM
Hello.

I would like to have a black and white CLI just as the shell in Amikit.

I use OS 3.1 and i have KCON installed.

I usually launch a KCON shell with "NewShell window KCON:"

Is there a way to achieve the same visual result as in Amikit?

Thanks for your help.
Title: Re: How to have a black and white CLI?
Post by: cv643d on April 01, 2011, 07:05:49 PM
I wonder how to do this to.
Title: Re: How to have a black and white CLI?
Post by: Matt_H on April 01, 2011, 07:12:15 PM
Something to do with Escape codes in S:Shell-Startup. You could copy from AmiKit, and I think Karlos knows how to do this, too.
Title: How to have a black and white CLI?
Post by: Karlos on April 01, 2011, 07:16:23 PM
Quote from: Xanxi;626562
Hello.

I would like to have a black and white CLI just as the shell in Amikit.

I use OS 3.1 and i have KCON installed.

I usually launch a KCON shell with "NewShell window KCON:"

Is there a way to achieve the same visual result as in Amikit?

Thanks for your help.


You don't need any particular shell for this, you set your shell console using escape sequences. I am not at my machine right now but can say an easy way to permanently set it is to modify your shell-startup and put the required sequence into your default prompt. That way, even if some shell application changes it temporarily, it will be reset to your chosen scheme as soon as the prompt returns.
Title: Re: How to have a black and white CLI?
Post by: Cass on April 01, 2011, 07:17:28 PM
Quote

Echo "*e[32;41;>1m"
;3x is text colour
;4x is background of text
;>x is background of window
;x is pen number from palette


That`s a black BG with white characters
Title: Re: How to have a black and white CLI?
Post by: Karlos on April 01, 2011, 07:26:47 PM
From here... (http://www.amiga.org/gallery/index.php?n=529)

My old 3.x shell startup looks like this:

Code: [Select]
echo "*e[>1m*e[32;41m*e[0;0H*e[J"
prompt "*n*e[>1m*e[33;41m*e[1m%N/%R.*e[30;41m%S>*e[0m*e[32;41m "
alias CLS "echo *"*E[0;0H*E[J*""
echo "AmigaOS $OS. Workbench (Disk) $Workbench, Kickstart (ROM) $Kickstart*n"
date
echo "*nMemory*n"
avail

The first line simply clears the screen so there's as little delay as possible. The line that really matters is the "prompt" line.

As Cass explains above, each of the "*[" introduces an escape sequence. To elaborate:

*e[>1m

Floods the console background with pen 1 (black)

*e[32;41m

sets the character colour to pen 2 (white) and the character cell colour to pen 1 (black).
Also, you can only use pens 0-9 I think. Anyhow, the other escape sequences in my prompt simply format it to show the process/return value in one colour and the path in another, as well as making them bold.
Title: Re: How to have a black and white CLI?
Post by: Xanxi on April 01, 2011, 09:38:59 PM
Thanks.
It's working fine :-)
Do you also know how to set up the starting directory?
NewCLI opens a CLI on Ram Disk: but newshell window KCON: opens it on Workbench:WBStartup.
Strange!
Title: Re: How to have a black and white CLI?
Post by: Karlos on April 01, 2011, 09:57:21 PM
If you always want it to start in the same location, just put a CD command in there :)