Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I use zsh in interactive mode, I get some glitches. This mainly happens when the command spills over onto a new line and I use backspace, with backspace leaving behind some glitches on the screen and moving the cursor to an odd position.

It happens in a VT, in xterm and urxvt, although it is most noticeable with my chosen terminal, urxvt.

When I use zsh as a login shell, it does not happen at all.

What could be causing this?

share|improve this question
Your description is a bit vague. Are you using a fancy prompt? (Does it still happen with a simple prompt?) Is the prompt the same in non-login and login instances of zsh? Are you using any non-ASCII characters in your prompt or in your input (e.g. a UTF-8 terminal with multibyte UTF-8 text involved)? – Chris Johnsen May 3 '10 at 9:23
up vote 3 down vote accepted

It would help if you showed what your PROMPT variable is set to when it's not working, but it's likely that you have escape sequences that are being counted in the width of the prompt. You can fix this by editing the value so that those sequences are surrounded by %{ ... %}.

share|improve this answer
That was it exactly :) – Jack May 3 '10 at 11:31

The shell and your terminal program have to agree on:

  • the size, capabilities and behaviour of the window;

  • the number of characters displayed on it; these numbers could start to differ e.g. when one side assumes Unicode while the other assumes Latin encoding, or when a backspace isn't handled correctly.

Your termcap / terminfo settings, and the configuration of your terminal program, must be consistent, or you get exactly the behaviour you describe.

Sadly, I'm not as proficient with these settings as I would like to be, and can't really pinpoint what you should change where. (Have to leave room for others to earn upvotes, huh? ;-) )

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .