View previous topic :: View next topic |
Author |
Message |
shira Tux's lil' helper
Joined: 27 Aug 2002 Posts: 122
|
Posted: Mon Feb 16, 2004 10:33 pm Post subject: wierd newline functionality |
|
|
I dunno when it started but one of my servers is acting kinda funky
at the end of every prompt does an extra newline like so:
serverbox / # [*I just hit enter*]
serverbox / #
or
serverbox / # ls
bin c etc lib opt root stage2-athlon-xp-20030910.tar.bz2 tmp var
boot dev home mnt proc sbin sys usr
serverbox / #
the cursor is always red too
it's not a big issue but it is rather annoying
is anyone else having/had this problem? |
|
Back to top |
|
|
meowsqueak Veteran
Joined: 26 Aug 2003 Posts: 1549 Location: New Zealand
|
Posted: Tue Feb 17, 2004 3:44 am Post subject: |
|
|
What does 'echo $PS1' show? |
|
Back to top |
|
|
shira Tux's lil' helper
Joined: 27 Aug 2002 Posts: 122
|
Posted: Sun Feb 22, 2004 8:06 pm Post subject: |
|
|
serverbox / # echo $PS1
\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]
it does some even wierder stuff with regular user prompts too:
serverbox / $ echo hello
hello
shira@
serverbox / $
PS1 for that is: \[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\] |
|
Back to top |
|
|
myuser Apprentice
Joined: 31 Jan 2004 Posts: 218
|
Posted: Sun Feb 22, 2004 10:20 pm Post subject: |
|
|
There is a feature called PROMPT_COMMAND as well.
Here a program can be set to run each time the prompt string is displayed.
What might be happening is it is set to display a new line then display prompt string.
So you actually get :
----------------------------------
#This line is blank but belongs to the prompt below
serverbox / # echo Hello
Hello
# This line is blank but not generated from above, but rather from below
serverbox / #
Check your .bashrc and your /etc/profile, for PROMPT_COMMAND being set. If it is, wonder very hard how that happened.
If the above does not apply, how are you accessing the box? and what has recently changed on the box? |
|
Back to top |
|
|
meowsqueak Veteran
Joined: 26 Aug 2003 Posts: 1549 Location: New Zealand
|
Posted: Sun Feb 22, 2004 11:14 pm Post subject: |
|
|
Some time ago I had trouble with \[\033... escape sequences. I use these instead and it solved all of my problems:
Code: | BLACK="\[\e[30m\]"
RED="\[\e[31m\]"
GREEN="\[\e[32m\]"
YELLOW="\[\e[33m\]"
BLUE="\[\e[34m\]"
MAGENTA="\[\e[35m\]"
CYAN="\[\e[36m\]"
WHITE="\[\e[37m\]"
OFF="\[\e[0m\]"
|
PROMPT_COMMAND is a possibility as myuser suggested.
Also, just a thought - check your /etc/hostname to make sure it's a single line. |
|
Back to top |
|
|
shira Tux's lil' helper
Joined: 27 Aug 2002 Posts: 122
|
Posted: Mon Feb 23, 2004 12:57 am Post subject: |
|
|
meowsqueak wrote: | Also, just a thought - check your /etc/hostname to make sure it's a single line. |
hehe, that was it
I shoulda checked there :-/
anyways, thanks |
|
Back to top |
|
|
|