Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I am using bash (v3.2.25) on linux, through xterm, through exceed. When using Ctrlu the cursor is moved next to the bash character prompt ($) but the rest of the line remains and is not erased as expected.

Where is the issue, xterm or bash? How to resove that issue please?

share|improve this question
What does bind -p | grep '\C-u' return? – choroba Oct 29 '12 at 12:52

bash is meant to send the escape sequence that in the terminfo database is known as "el" (clear to the end of line).

So another possibility is that the terminfo database is not correct (or possibly that the wrong entry in the terminfo database is queried if $TERM is not set properly.

Does tput el | cat -vt give you something like ^[[K? What's the value of $TERM?

For instance, I could obtain the same behavior as you describe by setting $TERM to mterm (where el is ^C).

You could also run bash through script to see what escape sequence is actually sent by bash upon Ctrl-U

share|improve this answer
$ tput el | cat -vt ^[[K – yves Baumes Oct 29 '12 at 13:35
And : $echo $TERM xterm – yves Baumes Oct 29 '12 at 13:35
Does printf 'abc\r\033[K\n' output an empty line or abc? – Stéphane Chazelas Oct 29 '12 at 14:07

Your Answer


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.