Re: [opensuse] Konsole problems



Martin,

On Thursday 05 April 2007 08:55, Martin J Hooper wrote:
Randall R Schulz wrote:
Martin,
Most likely there's a problem with your PS1 string. It appears
you're altering the color within the prompt, and any portions of
the prompt string that do not yield visible characters must be
surrounded with \[ (two characters, escape as necessary) and \].
Otherwise the cursor positioning code used when you, say back up
the cursor, erase parts of the line or wrap at the right margin,
have the wrong value for the cursor's position following the prompt
and subsequently send incorrect positioning commands.


Randall Schulz

Here is the part of .bashrc that changes the cursor - I have not much
knowledge about whats going on here...

# Define a few Color's
BLACK='\e[0;30m'
...
WHITE='\e[1;37m'
NC='\e[0m' # No Color


PS1="$CYAN$(ppwd \l)$LIGHTGREEN\u@\h:\W$NC >"

And that is definitely the problem. Change the PS1-setting command to
this:

PS1="\[$CYAN\]$(ppwd \l)\[$LIGHTGREEN\]\u@\h:\W\[$NC\] >"


The command "ppwd" is new to me. In my shell, it's a shell procedure
defined in /etc/bash.bashrc and emits multiple terminal escape
sequences but does not appear to enclose them in the required \[ and
\]. The comment on its definition is "Set xterm prompt with short path
(last 18 characters)". I tried using it in a BASH shell in Konsole, and
it yields no prompt at all. I'd probably drop it and directly refer to
the values you want in your prompt: $USER, $HOST, $PWD etc. Do you care
which terminal you're using (\l is replaced by "the basename of the
shell's terminal device name" (search for PS1 in the BASH man page).


Randall Schulz
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: Change prompt for root
    ... > By default, run a shell file fork a new cmd, you need ... > as a log shell. ... > acter of argument zero is -, commands are initially read ... >> I want to change root's prompt for solaris. ...
    (comp.unix.solaris)
  • Re: OT: Exporting a BASH prompt from a script
    ... >> change the prompt within the script, ... > When you run a script, it runs inside a new shell which is terminated ... If you want the commands in the script ...
    (Debian-User)
  • Re: Dropping DTR to access command mode during ppp session
    ... Then at the root prompt, ... Type your AT commands, and then hit ~. ... >According to the modem manual, dropping DTR will put the modem into ... Here's what I worry about. ...
    (freebsd-questions)
  • Re: Process Idle Time
    ... I basically want to know if the prompt is busy in any way. ... >> file in turn invokes several executables. ... it depends on what sorts of commands are used in the BAT or CMD file. ...
    (microsoft.public.win32.programmer.kernel)
  • [opensuse] Help installing openSUSE 10.2
    ... of the boot commands identified as runlevel 3. ... On boot screen use Other Options and enter 3 and press Enter to ... boot into runlevel 3, which is text mode with network. ... If computer gives you text mode login prompt enter user name, ...
    (SuSE)