Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
wierd newline functionality
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
shira
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2002
Posts: 122

PostPosted: Mon Feb 16, 2004 10:33 pm    Post subject: wierd newline functionality Reply with quote

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
View user's profile Send private message
meowsqueak
Veteran
Veteran


Joined: 26 Aug 2003
Posts: 1549
Location: New Zealand

PostPosted: Tue Feb 17, 2004 3:44 am    Post subject: Reply with quote

What does 'echo $PS1' show?
Back to top
View user's profile Send private message
shira
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2002
Posts: 122

PostPosted: Sun Feb 22, 2004 8:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
myuser
Apprentice
Apprentice


Joined: 31 Jan 2004
Posts: 218

PostPosted: Sun Feb 22, 2004 10:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
meowsqueak
Veteran
Veteran


Joined: 26 Aug 2003
Posts: 1549
Location: New Zealand

PostPosted: Sun Feb 22, 2004 11:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
shira
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2002
Posts: 122

PostPosted: Mon Feb 23, 2004 12:57 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum