Bash should not print ^C when pressing ctrl-c to abort reverse history search

Bug #568314 reported by Lars Volker
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
bash (Debian)
New
Unknown
bash (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Binary package hint: bash

When doing a regex history search by pressing ctrl+R and then typing some text, you often want to abort the search. If you do that with ctrl-C, in order not to accidentally run the command, then the shell prints a ^C inside the command, overwriting whatever was at that position before. This behavior also happens, when you interrupt any running command on the shell, thus signaling that the end of output is not the end as actually printed by the program.

So, in the first case it's a bug (or at least annoying), in the second it might be regarded a feature.

Steps to reproduce:
1. Open Shell
2. Press ctrl-R, type "ls"
3. Press ctrl-C

It's also visible if you run "sleep 10" and press ctrl-C or if you just press ctrl-C when on an idle prompt.

I've tested it with the xfce4-terminal and xterm, and in each with bash, dash and sh. Someone in IRC figured out, that zsh doesn't show this behavior. Someone else reported, that it happens in gentoo as well, suggesting that it might be an upstream problem.

The problem first appeared with karmic. It might be a readline issue as well.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: bash 4.1-2ubuntu2
ProcVersionSignature: Ubuntu 2.6.32-21.32-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-21-generic x86_64
NonfreeKernelModules: fglrx
Architecture: amd64
Date: Thu Apr 22 10:52:41 2010
InstallationMedia: Xubuntu 10.04 "Lucid Lynx" - Alpha amd64 (20100415)
ProcEnviron:
 PATH=(custom, user)
 LANG=de_DE.utf8
 SHELL=/bin/bash
SourcePackage: bash

Revision history for this message
Lars Volker (lv) wrote :
Revision history for this message
Philip Muškovac (yofel) wrote :

Workaround from Debian bug: (works fine here)

 stty -echoctl

Changed in bash (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Changed in bash (Debian):
status: Unknown → New
Revision history for this message
Kasper Dupont (ubuntu-launchpad-feb) wrote :

As far as I know only bash 4.0 does not have a workaround for this. In bash 4.1 there exist an inputrc setting that can be used to turn off the bug. Versions prior to 4.0 does not have this bug. Either the bugfix should be backported, or karmic should be updated from bash 4.0 to bash 4.1. With bash 4.1 adding "set disable-signal-echo on" to bashrc fixes the problem.

Revision history for this message
Kasper Dupont (ubuntu-launchpad-feb) wrote :

This bug is still present in "10.04.3 LTS"

It looks like the patch mentioned in http://<email address hidden>/msg708760.html that will allow the bug to be turned off has not yet been applied to 10.04.

I have a fully updated 10.04.3 LTS system, and bash reports version number 4.1.5(1)-release.

With this version of bash adding "set disable-signal-echo on" to inputrc does not fix the problem.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.