Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I recently starting using GNU screen via Byobu but I think the problem is related to screen.

I first SSH into a server and then do a reverse search to run a commonly run command (dump a the database). I've redacted some of the text, but because usually outputs (reverse-i-search)':` before the search, it pushed the line across the width of the terminal.

screenshot1

If I am happy with the search and accept the command, the rightmost text stays put. See below:

screenshot2

So, why is this "garbage text" staying in the window? It only happens in screen and only seems to happen for certain hosts that use my custom .bashrc formatting and don't have their own.

share|improve this question
1  
This is likely to be a shell misconfiguration, probably the lack of prompt protection suggested by mikel. What shell are you using (probably bash, but please confirm)? –  Gilles Jan 28 '11 at 20:26
    
I am using bash. I will look at my PS1 and if I can't figure it out, post it here. –  Ryan Kaskel Jan 30 '11 at 10:04

1 Answer 1

You are probably missing \[ and \] in your PS1. It needs to go around every non-printing escape sequence, e.g. the escape sequences used to color things blue and yellow.

See the bash man page for details. It's in the section titled "Prompting".

It's also documented in the info docs under Controlling the Prompt.

share|improve this answer
    
Thanks. I will have a look at the color escape sequences. Weird that it doesn't happen in any other terminal... –  Ryan Kaskel Jan 30 '11 at 10:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.