LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-07-2005, 09:45 PM   #1
ninjabob7
Member
 
Registered: Nov 2005
Distribution: Ubuntu 9.10 and Slackware 13.1
Posts: 78

Rep: Reputation: 15
Line wrapping broken on Bash 3.0


I just installed my first LFS 6.1 (yay me!), but am having a few problems. The biggest one is that the line wrapping isn't working properly on bash. Whenever I type a line that is too long (haven't counted the exact number of characters), it wraps before it gets to the edge of the screen (about 3 quarters of the way), then wraps back to the same line it started from and starts writing over the prompt and the beginning of the line. After the first wrap, it seems to work properly. I compiled bash exactly the way it said in the book, including the patch which is supposed to fix something like this. I recompiled it, but still have the same problem. It even happens when I chroot from the livecd! Any ideas what might be broken?
 
Old 12-08-2005, 03:32 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
Maybe a PS1 issue ? try export PS1='$ ' just in case
 
Old 12-08-2005, 07:54 PM   #3
ninjabob7
Member
 
Registered: Nov 2005
Distribution: Ubuntu 9.10 and Slackware 13.1
Posts: 78

Original Poster
Rep: Reputation: 15
Yep, that was it. It seems the color codes in my prompt messed it up. Any ideas why? Knoppix and the LFS livecd both have colored prompts, so why can't I? My prompt currently looks like this:
Code:
export PS1='\033[1;36m\u@\h\033[1;37m:\w\033[1;32m\$\033[00m '
 
Old 09-21-2009, 06:33 AM   #4
BoatX
LQ Newbie
 
Registered: Aug 2009
Location: Poland
Distribution: Slackware, Arch, Debian, Centos
Posts: 8

Rep: Reputation: 0
I recommend you using tput to colour your bash prompt.
you should check this art:
http://www.cyberciti.biz/faq/bash-sh...linux-or-unix/
 
Old 09-21-2009, 01:50 PM   #5
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Quote:
Originally Posted by ninjabob7 View Post
Yep, that was it. It seems the color codes in my prompt messed it up. Any ideas why? Knoppix and the LFS livecd both have colored prompts, so why can't I? My prompt currently looks like this:
Code:
export PS1='\033[1;36m\u@\h\033[1;37m:\w\033[1;32m\$\033[00m '
Bash doesn't realize that the color codes don't take any space unless you escape the color codes: \[\e[1;36m\]
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash shell script read file line by line. Darren[UoW] Programming 57 04-17-2016 07:07 PM
BASH: read every line in the files and use the line as parameters as another program tam3c36 Programming 10 12-07-2010 02:42 PM
bash prompt wrapping problems c0uchm0nster Linux - Software 3 09-29-2005 07:07 PM
line wrapping in terminal emetib Linux - General 4 10-29-2003 10:18 PM
bash line wrapping gone awol acid_kewpie Linux - Software 10 05-14-2003 06:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration