unexpected behaviour of read in command_not_found_handle

Bug #218748 reported by Thomas R.
4
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: command-not-found

OS: Kubuntu 7.10
Bash Version: 3.2-0ubuntu11
command-not-found version: 0.2.8ubuntu2
-------------------------------------------
I tried to create an own version of command_not_found_handle() containing a "read" command. This is what happens:
The "read" command sends the process to the background. Strangely, this only happens if "read" is invoked _behind_ "python /usr/lib/command-not-found", and the problem does not occur if the function is called explicitly.

$ command_not_found_handle(){ read -p "read 1"; python /usr/lib/command-not-found -- $1; read -p "read 2"; echo foo; }
$ command_not_found_handle sl
read 1
The program 'sl' is currently not installed. You can install it by typing:
sudo apt-get install sl
read 2
foo
$ # This works as expected. Now let's try to call the function implicitly:
$ sl
read 1
The program 'sl' is currently not installed. You can install it by typing:
sudo apt-get install sl
read 2
[1]+ Stopped sl
$ fg
sl

foo
$

Revision history for this message
Ralph Corderoy (ralph-inputplus) wrote :

Isn't this more of a bash(1) issue that command-not-found?

Revision history for this message
Thomas R. (pumbaa80) wrote :

> Isn't this more of a bash(1) issue
Yes, it probably is. Sorry, I didn't think it through.

Revision history for this message
Mika Fischer (zoop) wrote :

Confirmed on hardy. This should be reported upstream. I'll do it next week if noone else beats me to it :)

Changed in bash:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Rolf Leggewie (r0lf) wrote :

There hasn't been any activity in this ticket for a while. Is this still a problem in Jaunty or Karmic?

Changed in bash (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Thomas R. (pumbaa80) wrote :

Same problem in Jaunty. I haven't installed Karmic yet.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Thank you for reporting back. Resetting status.

Changed in bash (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Thomas R. (pumbaa80) wrote :

bug 233994 might have the same cause as this one

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.