Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

Offline XanxiTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2005
  • Posts: 900
    • Show only replies by Xanxi
How to have a black and white CLI?
« 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.
10 Classic Amiga Computers so far: I have too many computers!!
 

Offline cv643d

  • Hero Member
  • *****
  • Join Date: May 2003
  • Posts: 1197
    • Show only replies by cv643d
Re: How to have a black and white CLI?
« Reply #1 on: April 01, 2011, 07:05:49 PM »
I wonder how to do this to.
Amiga articles
"New shell. It was finished a while back, but I still see bugs, haha" - SSolie
 

Offline Matt_H

Re: How to have a black and white CLI?
« Reply #2 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.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
How to have a black and white CLI?
« Reply #3 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 Cass

  • Hero Member
  • *****
  • Join Date: Apr 2003
  • Posts: 826
  • Country: 00
    • Show only replies by Cass
Re: How to have a black and white CLI?
« Reply #4 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
"If we don't got it, you don't want it!"
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: How to have a black and white CLI?
« Reply #5 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 XanxiTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2005
  • Posts: 900
    • Show only replies by Xanxi
Re: How to have a black and white CLI?
« Reply #6 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!
10 Classic Amiga Computers so far: I have too many computers!!
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: How to have a black and white CLI?
« Reply #7 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