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.


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


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.

  • 2
    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

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.

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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