Skip to content

Conversation

@micahkepe
Copy link

Add Fish Shell Completions for Mutt-Wizard

Screenshot 2025-06-16 at 4 08 34 PM

Summary

This PR adds Fish shell completion support for the mw (mutt-wizard) command. The implementation includes comprehensive tab-completion options for all available command flags and subcommands, enhancing the user experience for Fish shell users.

Files Changed

1. Makefile

Modified the installation and uninstallation process to include Fish shell completions:

  • Added commands to create the Fish vendor completions directory
  • Added commands to copy and set permissions for the Fish completion file
  • Added removal of the Fish completion file during uninstallation

2. completion/mw.fish (New File)

Created a new Fish shell completion file that provides:

  • Completions for all main command flags (-a, -l, -d, etc.)
  • Contextual sub-options for the -a (add email address) command
  • Dynamic completion of email addresses for the -D and -y flags by parsing the output of mw -l

Reason for Changes

Fish shell is a popular alternative to Bash and Zsh that offers advanced features like autosuggestions and robust tab completion. This change improves the user experience for Fish shell users by providing the same level of command completion that was previously only available for Zsh users.

Impact of Changes

  • Fish shell users will now have access to comprehensive tab completion for the mw command
  • The installation and uninstallation processes have been updated to handle the new Fish completion file
  • No impact on existing functionality for non-Fish users

Test Plan

  • Installed the completions using make install
  • Verified that Fish shell correctly loads the completions
  • Tested tab completion for various commands and subcommands
  • Verified that dynamic email address completion works correctly
  • Confirmed that make uninstall properly removes the Fish completion file

Additional Notes

The Fish completion file follows the same pattern as the existing Zsh completion, but uses Fish's specific completion syntax. The implementation is comprehensive and covers all command options available in the mw tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant