help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Personalized Prompt


From: Jerry Lynch
Subject: Personalized Prompt
Date: Wed, 18 Oct 1995 21:31:36 -0400 (EDT)

I'm using octave 1.1.1 for Linux.  I have my prompt set in my .octaverc 
file as:

PS1="^[[34m[\\!] \\t \\w \\s\\$^[[0m "

Where "^[" is the escape character.  This allows me to change the color 
of my prompt.  This is very helpful when viewing the work-session.  
Everything works great, except when the command I enter wraps to the next 
line.  The problem is that when you search through the history (using 
control-p), lines that were wrapped don't display properly if you type 
'control-a' on them.

I feel this might not be clear, so here is an example:

[987] 21:19:02 ~ octave$ e2=[-1,0,0;-1,0,1;-1,0,-1;-1,-1,0;-1,1,0;-1,-
1,-1;-1,-1,1;-1,1,1;-1,1,-1]
e2 =

  -1   0   0
  -1   0   1
  -1   0  -1
  -1  -1   0
  -1   1   0
  -1  -1  -1
  -1  -1   1
  -1   1   1
  -1   1  -1

[988] 21:25:55 ~ octave$


--NOW I type "control-p":

[988] 21:25:55 ~ octave$ e2=[-1,0,0;-1,0,1;-1,0,-1;-1,-1,0;-1,1,0;-1,-
1,-1;-1,-1,1;-1,1,1;-1,1,-1]

--Then I type "control-a":

                              |---cursor is placed here.
                              v
[988] 21:27:09 ~ octave$ e2=$ 1,0,0;-1,0,1;-1,0,-1;-1,-1,0;-1,1,0;-1,-
1,-1;-1,-1,1;-1,1,1;-1,1,-1]


As best as I can tell, the "control-a" is basically off by the number of 
non-printable control characters.


Is there any way to fix this (and still use my control sequences)?

Thanks.

Jerry   <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]