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 03-28-2006, 04:02 PM   #1
spiffytech
Member
 
Registered: Dec 2005
Location: NC, USA
Distribution: (K)ubuntu
Posts: 139

Rep: Reputation: 15
multi-line command doesn't wrap correctly


I decided to change the default prompt values for Bash on my CentOS4 SSH terminal. I edited /etc/bashrc to use

PS1="\e[31;1m\] \n\n \w \! \u@\h \A \d\n\n>>> \e[0m"

Since doing this, multi-line Bash commands fail to wrap correctly. Instead of moving to a new line, the second line overwrites the first line, which is a mess to read and causes many other problems with the wraping when you try to do things like delete characters and such. How should I go about fixing this?
 
Old 03-28-2006, 04:54 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627
I decided to change the default prompt (..) How should I go about fixing this?
1. Undo
2. Read the http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/
3. Retry, but now *making* educated guesses :-]

BTW, don't post duplicate threads. If you need help with a thread, like changing the title, just ask this forums moderators.
 
Old 12-28-2008, 06:18 PM   #3
nakko
Member
 
Registered: Oct 2004
Location: Austin, TX
Distribution: Ubuntu Dapper Drake
Posts: 39

Rep: Reputation: 15
One thing I noticed that the link referred to by spiffytech was that in their "problems" section they omit this helpful tidbit, which is of particular use to me and (well, every frickin' body nowadays basically) others who use terminals in resize-able windows like PuTTY or Terminal.app or Gnome term, etc etc.

Add this to your /etc/profile or ~/.bash_profile or wherever it needs to go:
shopt -s checkwinsize

Worked for me, since my problem was not related to what I had in my PS1= line.
 
  


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
xterms wrap over the same line when typing! humbletech99 Linux - Software 6 12-30-2005 05:58 PM
VI wrap line Ephracis Linux - Newbie 4 11-17-2005 05:46 PM
need a command line program that doesn't screen wrap paperdiesel Linux - Software 1 10-04-2004 12:30 PM
bash does not wrap long lines correctly monkeyman2000 Linux - General 8 09-08-2004 09:30 PM
Line wrap with ximian evolution nouse66 Linux - Software 3 06-18-2004 08:33 AM

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

All times are GMT -5. The time now is 06:50 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
Open Source Consulting | Domain Registration