Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When you're editing a prompt in bash, and then press Ctrl-C to abort it, "^C" might get printed where the cursor has been.

When you were in the middle of the line, this makes copy'n'pasting more difficult and IIRC it can be configured to not display it (and overwrite parts of the command line).

I do not have this problem myself (using zsh, which does not print "^C"), but ran across this in a Konsole bug report.

share|improve this question
    
this happens to me in the current Ubuntu 10.04 under gnome-terminal and on an actual VT. i haven't fully tested, but it doesn't happen in the same gnome-terminal when SSH'd into a Debian system. –  quack quixote May 30 '10 at 1:02

1 Answer 1

up vote 8 down vote accepted

Give this a try:

stty -ctlecho

You can add that to your ~/.bashrc.

share|improve this answer
1  
checking with stty -a indicates the echoctl option is set; the manpage verifies echoctl and ctlecho are synonyms; running this command unsets the option. thanks! –  quack quixote May 30 '10 at 1:19
    
This works, but is probably a more general setting than only for this special case (aborting the command editing), isn't it? –  blueyed May 30 '10 at 1:20
    
@blueyed: Yes, it's more general. –  Dennis Williamson May 30 '10 at 3:01
    
@blueyed: i checked my bash's current readline settings for C-c, but found nothing. this is the only thing i've found that affects the issue, but maybe someone else will know of a more targetted fix. –  quack quixote May 30 '10 at 18:28
    
@quack quixote: There aren't any readline variables that affect this and though you can bind ^C to a readline function or macro but it won't do anything because the terminal driver controls its function. –  Dennis Williamson May 30 '10 at 20:13

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.