mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 08:46:10 +08:00

The "wrap chain" refers to a sequence of commands which wrap other commands, for completion purposes. One possibility is that a wrap chain will produce a combinatorial explosion or even an infinite loop, so there needs to be logic to prevent that. Part of that logic is encapsulated in a visited set (wrap_chain_visited_set_t) to prevent exploring the same item twice. Prior to this change, we stored pairs (command, wrapped_command). But we only really need to store the wrapped command. Switch to that. One consequence is that if a command wraps another command in more than one way, we won't explore both ways. This seems unlikely in practice.