[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Escape sequences....



hi 
  There was a slight mistake in what i wrote yesterday
      PS1=^[[s the rest of the thing is same.
I will tell you what it does.^[[ is an escape sequence
which is got by pressing ^v+escape button.
   ^[[s saves the current cursor position
   ^[[0;0H positions the cursor in the top of the screen.
   ^[[K clears the line
   ^[[01;37;43mPWD: displays the PWD: at top of the screen
   The parameter 01 represents bold
           37 represents some color(background)
           43 represents "    "     (foreground)
More on this can be found on /etc/DIR_COLORS
  ^[[01;33;41m$(pwd) represents the current working
directory(pwd) with 33 and 41 as bg and fg color.   
and the last 
  ^[[u restores the position to the current location
  \$ displays a prompt.
Well this works very well ,but has some small problems.
The escape character is to postion the cursors and it
controls the position.
U can do the same thing using c.U have to include
<termios.h> and initialize the terminal,etc.
Correct me if i am wrong.
vinu
 

On Tue, 20 Jun 2000 13:12:55 +0530
 "Linux List " <linux-prog@xxxxxxxxx> wrote:
> *This message was transferred with a trial version of
> CommuniGate(tm) Pro*
> I have played with that thing on various occasions.
> With this you can change the color of the font,etc.
> Say if you want to display the current working directory
> on the top of the console.You can use something like
> this.
> PS1=^[[P^[[0;0H^[[K^[[01;37;43mPWD:^[[01;33;41m$(pwd)^[[u/$
>   I dont remember that exactly.
> I got it from one of those old Gazette.The explanation
> is preety neat and simple,i will do that if you want.
> 
> vinu
> 
> 
>  
> On Mon, 19 Jun 2000 12:35:10 +0530 (IST)
>  Linac Is Not A Club <linac@xxxxxxxxxxxxxxxxxxxxxx>
> wrote:
> > *This message was transferred with a trial version of
> > CommuniGate(tm) Pro*
> > 
> > Does any one out there know what the escape sequence to
> > execute a command
> > on a terminal is ? I know that it's pkey something but
> I
> > don't know how to
> > actually use it. If any one does, do let me know.
> > 
> > thanx in advance.
> > 
> > ------------------------------------------------------------------------
> > Trifles make perfection, and perfection is no trifle.
> > 		-- Michelangelo
> > 
> > 
> > -----------------------------------------------------------------------
> > For information on this and other Linux India mailing
> > lists check out
> > http://lists.linux-india.org/
> 
> 
> -----------------------------------------------------------------------
> LIP is all for free speech.  But it was created for a
> purpose - to help
> people discuss technical programming related issues about
> Linux.  If
> your messages are counterproductive to this purpose, your
> privileges to
> submit messages can and will be revoked.