command-not-found should print something on the console immediately

Bug #335231 reported by Alexander Jones
2
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

Binary package hint: command-not-found

WHenever I goof a command like

alex@fizz:~$ pytohn blabla.py

if the command-not-found cache is cold, it may take a couple of seconds to return and finally print

bash: pytohn: command not found

During this time, I don't know whether the command is actually running or not.

Therefore, I suggest c-n-f prints something immediately like "pytohn not found. searching bla bla". At least then I can see straight away when I have goofed and have a chance to Ctrl+C it.

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia
Package: command-not-found 0.2.31ubuntu2
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: command-not-found
Uname: Linux 2.6.28-6-generic x86_64

Revision history for this message
Alexander Jones (alex-weej) wrote :
Revision history for this message
Øyvind Jensen (jegerjensen) wrote :

I support this proposal. The few seconds it takes feels like a very long time, so an immediate feedback would give the end user a smoother experience.

Michael Vogt (mvo)
Changed in command-not-found (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I think it's fairly easy to implement. We could set up a timer that goes of after 0.5 seconds from python startup and print something like "Searching... please wait". I'd love to implement this.

BTW: Does anyone know how to simulate "cold" storage reliably? I'd like to fine-tune the timer delay using some non-guessed value.

Revision history for this message
Michael Vogt (mvo) wrote :

@Zygmunt: You can run:
echo 3 > /proc/sys/vm/drop_caches

to get a cold disk cache again. On my (relatively new) system the time after that is:
$ time /usr/lib/command-not-found foobar
real 0m1.851s
user 0m0.208s
sys 0m0.144s

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Thanks Michael, this will be very handy!

I'm testing a dbus-based service that is starting on demand and exits after 60 seconds of inactivity. This makes it possible to get rid of "cold cache" issue. As a second step the now-trivial client can be rewritten in vala and linked statically to get fastest possible startup.

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.