Welcome, Guest. Please login or register.

Author Topic: How to have a black and white CLI?  (Read 2517 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
How to have a black and white CLI?
« 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.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: How to have a black and white CLI?
« Reply #1 on: April 01, 2011, 07:26:47 PM »
From here...

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.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: How to have a black and white CLI?
« Reply #2 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 :)
int p; // A