LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-01-2004, 10:39 AM   #16
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244

What does you expect with this prompt ?
 
Old 08-01-2004, 11:04 AM   #17
tinhat
LQ Newbie
 
Registered: Jul 2004
Distribution: Slackware
Posts: 22

Rep: Reputation: 15
Actually its the remnants of the bash_profile that shipped with VectorLinix 3.2. (In short I don't know)
I must have tried to modify it in some way screwing it up. I played around and got a usable PS1
by stripping out everything after "PS1=" and replacing it with PS1="\u@\h:\w\$ " which works.
No problems with line wrapping in the console.

Many thanks!
 
Old 08-01-2004, 05:34 PM   #18
SiegeX
Member
 
Registered: Jul 2004
Location: Silicon Valley, CA
Distribution: Slackware
Posts: 171

Rep: Reputation: 38
Kudos to whomever suggested the PS1 syntax issue because now that I remember back when making my prompt, that is exactly the issue I had, dunno why I forgot. Anyway here is a prompt I made, I think its pretty usefull, it puts the path you are in above the actual prompt because I hate it when I am in a very deep directory tree and everything line wraps. Also I colorized the prompt to yellow for regular users and red for root just so I remember not to do anything stupid as root. Toss all of this into your ~/.bash_profile or ~/.profile.

Code:
function my_prompt_command {
 local WHITE=`echo -e "\033[1;37m\c"`
 local BLUE=`echo -e "\033[1;34m\c"`
 local GREEN=`echo -e "\033[1;32m\c]"`
 local DOWNBRACK=`echo -e "\033(0\154\161\033(B\c"`
 local PWD=`pwd`
#echo -e "$WHITE$DOWNBRACK($PWD)"
 echo -e "$WHITE($PWD)"
}

PROMPT_COMMAND=my_prompt_command

function fluxprompt {
 local WHITE="\[\033[1;37m\]"
 local CYAN="\[\033[1;36m\]"
 local YELLOW="\[\033[1;33m\]"
 local RED="\[\033[1;31m\]"
 local NO_COLOR="\[\033[0m\]"
 local UPBRACK=`echo -e "\[\033(0\155\161\033(B\c\]"`

 case $TERM in
     xterm*|rxvt*|Eterm*)
         TITLEBAR='\[\033]0;\u@\h:\w\007\]'
         ;;
     *)
         TITLEBAR=""
         ;;
 esac

PS1="$TITLEBAR\
$WHITE[\
$YELLOW\u@\h\
$WHITE]\
$NO_COLOR\\$ "
}

fluxprompt
It ends up looking something like this:
Code:
(/usr/share/sendmail/cf/cf)
[root@maximus]#
To make it red for root simply change the line near the bottom that says
Code:
$YELLOW\u@\h\
to
$RED\u@\h\
Also, for all you bash guru's out there, if you notice in my prompt I have commented out the line in function fluxprompt {} section.
Code:
#echo -e "$WHITE$DOWNBRACK($PWD)"
When I made this prompt back when I was using Mandrake 9.2, this made a nice little ASCI bracket and I used a similar one called UPBRACK in the PS1 var to connect them together, it approximatly looks like this.
Code:
 _
| (/usr/share/sendmail/cf/cf)
|_[root@maximus]#
Well the reason I commented them out was because in Slackware 9.1/10 it outputs the letters 'lq' and 'mq' instead of the nice little brackets and looks like this:
Code:
lq(/usr/share/sendmail/cf/cf)
mq[root@maximus]#
The odd thing is when I ssh into my box with PuTTY, I see the nice brakets . If sombody could shed some light as to why this is I would appreciate it. Thanks

Last edited by SiegeX; 08-01-2004 at 05:51 PM.
 
Old 08-31-2005, 05:36 PM   #19
vrox
LQ Newbie
 
Registered: Aug 2005
Posts: 1

Rep: Reputation: 0
Quote:
Originally posted by Cedrik
Try :

stty cols 40 rows 25

(adjust the 40 value to suit your needs)
Thank you so much! You have no idea how irritating this has been
 
Old 09-01-2005, 12:50 AM   #20
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Original Poster
Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Quite the bump here.

But since I never posted a close for this, I might as well do it now.

If I recall correctly, in the end, it turns out Cedrik got it right, and it was a problem in my PS1 line. Somewhere along the line I modified it, and screwed it up somehow.

Writing a new custom line from scratch fixed it.
 
  


Reply



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
How do I see all text in console? fannymites Linux - General 2 04-15-2005 06:01 PM
Desktop Text wrapping Commando464 SUSE / openSUSE 1 10-23-2004 04:44 AM
Console text gamehack Slackware 6 09-25-2004 04:00 AM
wrapping text and scrolling using ncurses questioner Programming 1 10-12-2003 11:29 AM
Wrapping text in tables Graanco Programming 1 09-27-2001 04:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:21 AM.

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