LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-11-2012, 07:34 PM   #1
remuda
LQ Newbie
 
Registered: Feb 2009
Location: Texas
Distribution: Slackware
Posts: 2

Rep: Reputation: 0
Missing characters in xterm after customizing local .bashrc file.


Hi,

I running Slackware v14 and learning how to customize my xterm by editing my local .bashrc file.

The only two entries I have in the file are:
Code:
PS1="[\T](\u) \W \$ "
export PS1
When I start up xterm, the prompt has changed as expected but I'm unable to enter the characters 'P' and 'e' in the terminal. If I delete the two entries and restart the terminal using the default configuration file, I'm able to key in all of the characters.

What's causing this and how do fix it?

TIA
 
Old 09-11-2012, 11:03 PM   #2
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch
Posts: 443

Rep: Reputation: 21
Quote:
Originally Posted by remuda View Post
Hi,

I running Slackware v14 and learning how to customize my xterm by editing my local .bashrc file.

The only two entries I have in the file are:
Code:
PS1="[\T](\u) \W \$ "
export PS1
When I start up xterm, the prompt has changed as expected but I'm unable to enter the characters 'P' and 'e' in the terminal. If I delete the two entries and restart the terminal using the default configuration file, I'm able to key in all of the characters.

What's causing this and how do fix it?

TIA
Shouldn't be any problem with it. I put it at the end of my .bashrc and it works fine, P and e and all other letters as normal. I'm using slackware 13.37. The only thing I can think of is that it may be related to slackware 14. Try asking on the slackware forum.

Last edited by porphyry5; 09-11-2012 at 11:06 PM.
 
Old 09-11-2012, 11:30 PM   #3
uhgreen
LQ Newbie
 
Registered: Apr 2010
Distribution: Slackware
Posts: 12

Rep: Reputation: 0
Quote:
Originally Posted by remuda View Post
Hi,

I running Slackware v14 and learning how to customize my xterm by editing my local .bashrc file.

The only two entries I have in the file are:
Code:
PS1="[\T](\u) \W \$ "
export PS1
When I start up xterm, the prompt has changed as expected but I'm unable to enter the characters 'P' and 'e' in the terminal. If I delete the two entries and restart the terminal using the default configuration file, I'm able to key in all of the characters.

What's causing this and how do fix it?

TIA
I'm running Slackware 14 RC 4 and when I put this in my .bashrc it works fine. I am able to enter the characters P and e. Unfortunately I can't help with the problem but hopefully this might help narrow something down for you. Good luck!
 
Old 09-13-2012, 03:16 PM   #4
aniketmeshram
LQ Newbie
 
Registered: Feb 2011
Distribution: OpenSUSE 10.3, Fedora, Ubuntu
Posts: 23

Rep: Reputation: 1
I can't understand why the code:
Code:
PS1="[\T](\u) \W \$ "
export PS1
is giving you problems. It work fine when it tried. Alright try putting it elsewhere i.e. your home bash profile or the root bashrc file or root profile. see if if you still experience the problem.

Cheers.
 
Old 09-13-2012, 03:59 PM   #5
Obscurious
LQ Newbie
 
Registered: Jun 2009
Distribution: Debian, RHEL, FreeBSD
Posts: 17

Rep: Reputation: 0
I have found that the bash prompt is very sensitive, i.e. one PS1 string will mostly work but a slight change can have drastic consequences. For example, I formatted my prompt with:

Code:
PS1='\e[1;32m\h\e[0m(\e[0;31m\w\e[0m)\e[1;34m\$ \e[0m'
Which looked like what I had in mind, but somethings didn't feel right such as line wrapping on large commands. I surrounded each item in straight braces [ ], to yield:

Code:
PS1='\[\e[1;32m\]\h\[\e[0m\](\[\e[0;31m\]\w\[\e[0m\])\[\e[1;34m\]\$ \[\e[0m\]'
And it worked like a charm!

My point is that there are many solutions to your target. Small changes can have large impacts. I suggest trying single quotes in your PS1 string instead of double quotes.

Last edited by Obscurious; 09-13-2012 at 04:12 PM.
 
Old 09-13-2012, 04:08 PM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Try enclosing the value assigned to PS1 in single quotes. There is no purpose to allowing the shell to interpret anything in the string before it is assigned. There are some 'special' characters in the string which might be interpreted/expanded by the shell, which isn't what you want. If you echo $PS1, it should reveal any such translations. Also, type set which may reveal any aliases or functions that might be silently participating in some meddling with the terminal.

--- rod.

Last edited by theNbomr; 09-13-2012 at 04:13 PM.
 
Old 09-15-2012, 12:03 PM   #7
remuda
LQ Newbie
 
Registered: Feb 2009
Location: Texas
Distribution: Slackware
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for all of the responses. The single quotes made it work.
 
  


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
how to copy ~/.bashrc file to local 768 Linux - Newbie 3 05-21-2012 10:27 PM
how would you use scp to copy your ~/.bashrc file from bravo to the local system? marty gallagher Linux - Newbie 1 11-10-2011 09:28 PM
xterm and .bashrc xadrith Linux - Newbie 2 06-22-2008 05:46 PM
Xterm and meta characters Khabi Linux - Software 1 09-20-2005 05:31 PM
custom xterm title when already defined in .bashrc brian0918 Linux - Software 1 06-01-2004 12:17 PM


All times are GMT -5. The time now is 05:04 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