When using the bash source command command-not-found behaves as if it was interactive
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
command-not-found (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
When using the bash "source" command from an interactive shell it is
1) very slow
2) pressing Control-C repeatedly reports python errors like:
Failed to import the site module
Traceback (most recent call last):
File "/usr/lib/
main()
This has been verified on Ubuntu 14 and 18.
This can be reproduced by sourcing a file with about 50 lines of a word which is not found.
For example:
for i in $(seq 50); do echo lss ; done > bad.sh
source ./bad.sh
output will show something like:
No command 'lss' found, did you mean:
Command 'ss' from package 'iproute2' (main)
Command 'ls' from package 'coreutils' (main)
...
Additionally, if you try to press ^C repeatedly you will get the errors from Python.
I would have expected the command-not-found to behave as if it was in a non interactive shell and not provide
interactive feedback, and not slow down the execution by doing a search that significantly slows the executions.
Thanks,
-tom