View previous topic :: View next topic |
Author |
Message |
Rec n00b
Joined: 16 Sep 2004 Posts: 5
|
Posted: Thu Sep 16, 2004 3:33 pm Post subject: Odd commandline wrapping. |
|
|
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 |
|
|
jftuga Tux's lil' helper
Joined: 21 Jan 2004 Posts: 139 Location: Athens, GA
|
Posted: Thu Sep 16, 2004 3:42 pm Post subject: |
|
|
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 |
|
|
Rec n00b
Joined: 16 Sep 2004 Posts: 5
|
Posted: Thu Sep 16, 2004 3:47 pm Post subject: |
|
|
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 |
|
|
stahlsau Guru
Joined: 09 Jan 2004 Posts: 584 Location: WildWestwoods
|
Posted: Thu Sep 16, 2004 4:11 pm Post subject: |
|
|
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 |
|
|
Rec n00b
Joined: 16 Sep 2004 Posts: 5
|
Posted: Thu Sep 16, 2004 6:14 pm Post subject: |
|
|
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 |
|
|
|