#12957·fish-shell

Custom function "rm" gets executed while auto-completing

Author: Secreto31126Created Aug 28, 2026Updated Sep 3, 2026

After a few "incidents", I decided to change my rm command to something with more warnings and delays, so I wrote the following function:

fish
function rm
      echo "Get ready to delete files..."
      notify-send "Get ready to delete files..."
      sleep 10
      command rm $argv
end

This, however, resulted in an unexpected side effect. Whenever I start typing a rm command, after I type the first letter of the path to remove, the function gets instantly executed: the notification is sent and my shell freeze for 10 seconds. Curiously, the rm command doesn't get executed.

In my testing, this issue happens exclusively with the rm function, any other function name works as expected. If I have to guess, there's some special behavior around the rm command, but I couldn't find anything related to that in Google, so I doubt this is intended.

https://github.com/user-attachments/assets/855526ed-91aa-4c25-b1b9-e65c38171491

Details

fish --version: fish, version 4.8.1 uname -a: Linux Matrix 7.2.0-1-cachyos #1 SMP PREEMPT_DYNAMIC Thu, 20 Aug 2026 16:18:38 +0000 x86_64 GNU/Linux $TERMINAL --version: kitty 0.48.2