Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Odd commandline wrapping.
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
Rec
n00b
n00b


Joined: 16 Sep 2004
Posts: 5

PostPosted: Thu Sep 16, 2004 3:33 pm    Post subject: Odd commandline wrapping. Reply with quote

A strage problem developed with my commandline about a week ago. I did a world update before it started happening. I'm not sure if it's a bash, readline, xterm (gnome-terminal), or configuration error. This is what happens.

If I type a line longer than about 1/4 the width of my term, it then wraps, but not onto the next line, but the current one. It ends up looking like this:

ld -pveternity: bob ]# emerge -u wor

This is with 80 char width.

app-shells/bash-completion-20040704-r1 *
app-shells/bash-3.0-r5 *
sys-libs/readline-5.0 *
x11-terms/gnome-terminal-2.6.1-r1 *

If anyone could shed some light on this problem, or needs any more information to help, please let me know.

(P.S. I just checked, and this behavior happens in vanilla xterm as well)
Back to top
View user's profile Send private message
jftuga
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2004
Posts: 139
Location: Athens, GA

PostPosted: Thu Sep 16, 2004 3:42 pm    Post subject: Reply with quote

If you use bash, try putting this into your .bash_profile and/or .bashrc:

shopt -s checkwinsize

From the bash man page:

checkwinsize
If set, bash checks the window size after each command and, if necessary, updates the values of LINES and COLUMNS.


-John
Back to top
View user's profile Send private message
Rec
n00b
n00b


Joined: 16 Sep 2004
Posts: 5

PostPosted: Thu Sep 16, 2004 3:47 pm    Post subject: Reply with quote

Added it to .bash_profile, logged in again, checked shopt. That option is now enabled, but it's still having the same problem.

Thank you, though, for the tip.
Back to top
View user's profile Send private message
stahlsau
Guru
Guru


Joined: 09 Jan 2004
Posts: 584
Location: WildWestwoods

PostPosted: Thu Sep 16, 2004 4:11 pm    Post subject: Reply with quote

This problem often appears if s/o modified his prompt with errors. For example those color-tags have to look like this: [\033[35m\].
Try to remove all that stuff from your .bashrc or profile, and lookout if the problem is gone.
Back to top
View user's profile Send private message
Rec
n00b
n00b


Joined: 16 Sep 2004
Posts: 5

PostPosted: Thu Sep 16, 2004 6:14 pm    Post subject: Reply with quote

Thanks, that fixed my problem. I have a thing in my prompt that sets the xterm title, and that was what was causing it.

For anyone interested, this is what my .prompt file looks like (I source .prompt in my bash configs)

Code:
# Prompt
function jobcount {
   ASDF=`jobs | wc -l | tr -d " " | grep -v '^0$'`

   if [ $ASDF ]; then
        echo "($ASDF)"
   fi
}
function prompt_title {
    USER=`whoami`
    if [ $TERM = "xterm" ]; then
        echo \(`/sbin/ifconfig | grep inet | grep -v '127.0.0.1' | awk '{print \$2}'| sed -e 's/addr://'`\) $USER\@$HOSTNAME:`pwd`
    fi
}
export -f jobcount
export -f prompt_title
export PS1='\[\033]2;`prompt_title`\007\]\[\033[1;31m\][\[\033[1;32m\]\u@\h\[\033[0;37m\]:\[\033[1;34m\]\W\[\033[1;31m\]]\[\033[0;37m\]`jobcount`\$\[\033[0m\] '

The jobcount part is the most useful, imho.
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