2

When I write a command that does not exist in the fish shell (let's say l instead of ls), fish takes some time before responding that the command does not exist.

I don't know if it looks for package to install or something else, but it is a bit annoying and I need to hit Ctrl-C to avoid waiting a few seconds.

Is there a way to disable this "feature", whatever it is?

  • 1
    This is probably the command-not-found handler. What is your operating system? – ridiculous_fish Oct 28 '15 at 17:06
  • GNU/Linux (ArchLinux). I found out that if I enter twice the same wrong command, the second time I wait less time. – antoyo Oct 28 '15 at 22:54
4

As ridiculous_fish says, this is probably due to the command-not-found handler.

You can try adding this suggestion to your config.fish:

function __fish_default_command_not_found_handler --on-event fish_command_not_found
  functions --erase __fish_command_not_found_setup
  echo "'$argv' not found"
end
  • Thanks. With this function, I get the message twice, but I does not solve the issue (it is as slow as before). At first, I thought that it could take some time to look in $PATH, but the syntax highlighting is quick, so I am not sure it could causes this issue. What else could cause this issue? – antoyo Oct 29 '15 at 2:24
  • You could run fish under strace and see what it's blocking on. – Zanchey Oct 29 '15 at 9:05
  • One noticeable difference when running strace is that I see more select(8, [7], NULL, NULL, {0, 10000}) = 0 (Timeout) when it is slower. What does it mean? – antoyo Oct 30 '15 at 14:12
  • Could you open an issue on Github and we can try to get to the bottom of it? – Zanchey Oct 31 '15 at 11:53
  • 1
    That was indeed the solution. For some reason, fish did not load it correctly the first time I tried this solution. After a reboot, everything is fine. Thanks. – antoyo Nov 1 '15 at 4:46
1

Since the other answer does not work anymore, I found another solution which consists of adding this function in config.fish:

function __fish_command_not_found_handler --on-event fish_command_not_found
    echo "fish: Unknown command '$argv'"
end

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.