LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Missing characters in xterm after customizing local .bashrc file. (https://www.linuxquestions.org/questions/linux-newbie-8/missing-characters-in-xterm-after-customizing-local-bashrc-file-4175426769/)

remuda 09-11-2012 06:34 PM

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

porphyry5 09-11-2012 10:03 PM

Quote:

Originally Posted by remuda (Post 4778018)
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.

uhgreen 09-11-2012 10:30 PM

Quote:

Originally Posted by remuda (Post 4778018)
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!

aniketmeshram 09-13-2012 02:16 PM

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.

Obscurious 09-13-2012 02:59 PM

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.

theNbomr 09-13-2012 03:08 PM

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.

remuda 09-15-2012 11:03 AM

Thanks for all of the responses. The single quotes made it work.


All times are GMT -5. The time now is 02:06 AM.