From 67a9d087789be954f557a8abb878820152392165 Mon Sep 17 00:00:00 2001 From: Karel Balej Date: Thu, 18 Sep 2025 09:02:37 +0200 Subject: [PATCH] completions/mpc: conditionally enable file completion for add and insert When connecting to MPD via a Unix socket, mpc add and insert accept absolute paths to local files. Offer these in the completion if the completed token starts with a slash after expansion. --- share/completions/mpc.fish | 1 + 1 file changed, 1 insertion(+) diff --git a/share/completions/mpc.fish b/share/completions/mpc.fish index 55857c53d..a2a308eac 100644 --- a/share/completions/mpc.fish +++ b/share/completions/mpc.fish @@ -85,6 +85,7 @@ complete -c mpc -n "not __fish_seen_subcommand_from $subcommands" -a current -d # Using '(mpc search filename (commandline -ct))' _might_ be faster for larger libraries complete -c mpc -n "__fish_seen_subcommand_from add insert" -a "(mpc listall)" +complete -c mpc -n "__fish_seen_subcommand_from add insert" -n 'string match -qr -- ^/ "$(commandline -xt)"' -F complete -c mpc -n "__fish_seen_subcommand_from playlist load" -a "(mpc lsplaylists)" complete -c mpc -n "__fish_seen_subcommand_from consume random repeat single" -a "on off"