int distance = termux_levenshtein_distance(command_not_found, binary_name);
if (distance == 0 && strcmp(command_not_found, binary_name) == 0) {
if (best_distance == 0) {
int distance = termux_levenshtein_distance(command_not_found, binary_name);
if (distance == 0 && strcmp(command_not_found, binary_name) == 0) {
if (best_distance == 0) {
- printf("No command '%s' found, did you mean:\n", command_not_found);
+ fprintf(stderr, "No command '%s' found, did you mean:\n", command_not_found);
- printf(" Command '%s' from package '%s'\n", best_command_guess, best_package_guess);
+ fprintf(stderr, " Command '%s' from package '%s'\n", best_command_guess, best_package_guess);
} else {
// Multiple suggestions at the same distance - show them all:
for (int i = 0; i < num_commands; i++) {
} else {
// Multiple suggestions at the same distance - show them all:
for (int i = 0; i < num_commands; i++) {
char const* binary_name = current_line + 1;
int distance = termux_levenshtein_distance(command_not_found, binary_name);
if (best_distance == distance) {
char const* binary_name = current_line + 1;
int distance = termux_levenshtein_distance(command_not_found, binary_name);
if (best_distance == distance) {
- printf(" Command '%s' from package '%s'\n", binary_name, current_package);
+ fprintf(stderr, " Command '%s' from package '%s'\n", binary_name, current_package);