Wishlist: don't print anything if not connected to a terminal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
command-not-found (Ubuntu) |
Fix Released
|
Medium
|
Michael Vogt |
Bug Description
Binary package hint: command-not-found
On a Gutsy box, I was dropped into a root shell when fsck failed.
In that particular situation, you probably don't want to be distracted by impertinent error messages.
I see that bug #129257 fixes the problem that the command-not-found output was being printed to standard output. However, I would additionally like to suggest that it simply stay quiet if not connected to a terminal. If the command which could not be found is being invoked from a script, the suggestion to install the missing package is rarely what is needed or expected, and even less so if the problem is with the PATH.
For the record, the single-user root shell runs with a PATH which does not include /usr/bin, and yet there are commands from /usr/bin such as lesspipe being invoked from root's standard .bashrc. Perhaps these should be conditional etc; if requested, I will file a separate bug about that.
vnix$ PATH=/sbin:
vnix$ lesspipe
Command 'lesspipe' is available in '/usr/bin/lesspipe'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
bash: lesspipe: command not found
vnix$ eval "$(lesspipe)"
bash: lesspipe: command not found
bash: Command: command not found
bash: The: command not found
vnix$ fgrep lesspipe /root/.bashrc
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
Changed in command-not-found: | |
importance: | Undecided → Wishlist |
For the record, see also my recent follow-up to bug #129257