Unix Shell - Entering long command does not wrap line

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > October 2004 > Entering long command does not wrap line





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Entering long command does not wrap line
javacrypto

2004-09-28, 3:32 am

When I type a long command into any terminal, the text I am typing
does not wrap to the next line. Instead, it overwrites the text on the
current line. The command is still runnable, but it is hard to look at
the whole thing at once.

The problem happens with all X-based terminal programs, and also
outside of X. This makes it look like a system problem instead of a
problem with one program.

Could this be related to the terminfo files? I have poked around in
the man pages for this, but nothing looks promising. Besides, I don't
know how to recompile these files.

I am running Debian/Unstable on an AMD.
Icarus Sparry

2004-09-28, 3:32 am

On Mon, 27 Sep 2004 20:03:33 -0700, javacrypto wrote:

> When I type a long command into any terminal, the text I am typing
> does not wrap to the next line. Instead, it overwrites the text on the
> current line. The command is still runnable, but it is hard to look at
> the whole thing at once.
>
> The problem happens with all X-based terminal programs, and also
> outside of X. This makes it look like a system problem instead of a
> problem with one program.
>
> Could this be related to the terminfo files? I have poked around in
> the man pages for this, but nothing looks promising. Besides, I don't
> know how to recompile these files.
>
> I am running Debian/Unstable on an AMD.


It could be related to terminfo. You haven't told us which shell you are
using, (it is probably 'bash' as you are on Debian, but it could be tcsh,
ksh, rc, etc).

What is the value of the TERM environment variable?

Do you have an file ~/.inputrc ?

Do you have a prompt set? Does it have any escape sequences in it e.g. to
set the title of the xterm (or whatever you are using)?

Try the following (all on one line)

PS1='$ ' INPUTRC=/dev/null bash --noprofile --login

and see if it works any better. If so, then it could be your prompt (the
PS1 variable), or one of these files ~/.inputrc, /etc/inputrc,
/etc/profile, ~/.bash_profile, ~/.bash_login or ~/.profile

javacrypto

2004-10-02, 9:13 pm

> It could be related to terminfo. You haven't told us which shell you are
> using, (it is probably 'bash' as you are on Debian, but it could be tcsh,
> ksh, rc, etc).


I am using bash as the shell.

> What is the value of the TERM environment variable?


TERM = xterm

> Do you have an file ~/.inputrc ?


No. I will look that up and see that I need to put there.

> Do you have a prompt set? Does it have any escape sequences in it e.g. to
> set the title of the xterm (or whatever you are using)?


The current prompt is:

\[\033[0;36m\]\u:\W\$\033[0m\]

I don't know what any of that means any more. I'll look that up too.

> Try the following (all on one line)
>
> PS1='$ ' INPUTRC=/dev/null bash --noprofile --login
>
> and see if it works any better. If so, then it could be your prompt (the
> PS1 variable), or one of these files ~/.inputrc, /etc/inputrc,
> /etc/profile, ~/.bash_profile, ~/.bash_login or ~/.profile


Setting the prompt like you suggest fixes the problem. I'll look up
how the PS* variables are supposed to be set, and pick something sane.

Thanks for the help. I did not know where to look to troubleshoot this
problem.

Chris
javacrypto

2004-10-02, 9:13 pm

Thanks to your message, I figured it out. I caused the problem myself
by trying to read.

I read the Bash Prompt HOW-TO, and found the suggestion to make a PS1
like this:

PS1='\[\033[1;33m\]>\[\033[0m\] '

This gives a colored prompt.

Here is the line I put into .bashrc:

PS1='\[\033[0;36m\]\u:\W\$\033[0m\] '

I added the user, working dir, and the \$ which changes the symbol to
# if the user is root. Note, however, that I missed '\[' after the $.
This screws up the line-wrapping.

Here is the line I am going to use:

PS1='\[\033[0;36m\]\u:\W\$\[\033[0m\] '

That's what I get for reading. It's funny, though. I must have set
this a long time ago, but only notice the problem recently. Hmm.

Chris
javacrypto

2004-10-04, 6:01 pm

Thanks to your message, I figured it out. I caused the problem myself
by trying to read.

I read the Bash Prompt HOW-TO, and found the suggestion to make a PS1
like this:

PS1='\[\033[1;33m\]>\[\033[0m\] '

This gives a colored prompt.

Here is the line I put into .bashrc:

PS1='\[\033[0;36m\]\u:\W\$\033[0m\] '

I added the user, working dir, and the \$ which changes the symbol to
# if the user is root. Note, however, that I missed '\[' after the $.
This screws up the line-wrapping.

Here is the line I am going to use:

PS1='\[\033[0;36m\]\u:\W\$\[\033[0m\] '

That's what I get for reading. It's funny, though. I must have set
this a long time ago, but only notice the problem recently. Hmm.

Chris
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com