Skip to content

fix(env): clear fish completions when setting/unsetting shell aliases#8324

Merged
jdx merged 1 commit intomainfrom
fix/fish-alias-completions
Feb 24, 2026
Merged

fix(env): clear fish completions when setting/unsetting shell aliases#8324
jdx merged 1 commit intomainfrom
fix/fish-alias-completions

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Feb 24, 2026

Summary

  • Add complete -e {name} before alias in fish set_alias to clear stale completions
  • Add complete -e {name} before functions -e in fish unset_alias to clean up leaked completions
  • Add fish e2e test for alias completion management

Fixes #8322

Test plan

  • Existing test_shell_alias e2e tests pass (bash)
  • New test_shell_alias_fish.fish e2e test verifies complete -e is emitted on both set and unset
  • Unit tests pass

🤖 Generated with Claude Code


Note

Low Risk
Fish-only shell hook output changes plus an e2e test; low blast radius but could affect users relying on custom fish completions for alias names.

Overview
Updates fish alias management to proactively clear any existing completions for the alias name by emitting complete -e {name} before both setting (alias ...) and unsetting (functions -e ...) an alias.

Adds a new fish e2e test (test_shell_alias_fish.fish) that asserts mise hook-env -s fish --force includes the completion cleanup lines on alias creation and removal, preventing stale/leaked completions across config changes.

Written by Cursor Bugbot for commit 79eb19a. This will update automatically on new commits. Configure here.

Fish's `alias` command internally creates completion entries via
`--wraps`. When mise removed an alias with `functions -e`, those
completions were left behind. Similarly, when creating an alias, any
pre-existing completions for that name could conflict.

Add `complete -e {name}` to both set_alias and unset_alias in the fish
shell implementation to properly manage completions.

Fixes #8322

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 24, 2026 03:04
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jdx, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue with Fish shell alias completions by modifying how aliases are set and unset. It ensures that complete -e is called to explicitly clear existing completions before defining or removing an alias, preventing stale or leaked completion entries. A new end-to-end test has been added to validate this behavior.

Highlights

  • Fish Shell Alias Management: Ensured that complete -e {name} is executed before setting an alias in Fish shell to clear any stale completions.
  • Fish Shell Alias Cleanup: Ensured that complete -e {name} is executed before unsetting an alias in Fish shell to prevent leaked completions.
  • End-to-End Testing: Introduced a new end-to-end test specifically for Fish shell alias completion management to verify the fix.
Changelog
  • e2e/cli/test_shell_alias_fish.fish
    • Added a new end-to-end test file to verify Fish shell alias completion behavior.
  • src/shell/fish.rs
    • Modified the set_alias function to include complete -e {name} before the alias command.
    • Modified the unset_alias function to include complete -e {name} before the functions -e command.
Activity
  • The set_alias function in src/shell/fish.rs was updated to include complete -e {name} before the alias command.
  • The unset_alias function in src/shell/fish.rs was updated to include complete -e {name} before the functions -e command.
  • A new end-to-end test file, e2e/cli/test_shell_alias_fish.fish, was added to validate the Fish shell alias completion management.
  • Existing test_shell_alias e2e tests for bash were confirmed to pass.
  • The new test_shell_alias_fish.fish e2e test was verified to confirm complete -e is emitted on both alias set and unset operations.
  • All unit tests were confirmed to pass.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request correctly addresses the issue of stale or leaked fish shell completions when managing aliases. By adding complete -e {name} before setting or unsetting an alias, it ensures that any existing completions (including those inherited via --wraps) are cleared, allowing the new alias definition to correctly establish its own completions. The implementation follows existing patterns in the codebase, uses proper shell escaping, and includes a robust e2e test to verify the fix.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a fish shell-specific issue where completions leak when shell aliases are dynamically managed by mise. The fix adds complete -e {name} commands to clear stale completions before setting or unsetting aliases.

Changes:

  • Add complete -e {name} before alias command in fish set_alias to clear stale completions
  • Add complete -e {name} before functions -e in fish unset_alias to clean up leaked completions
  • Add fish-specific e2e test to verify completion cleanup on both set and unset operations

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/shell/fish.rs Modified set_alias and unset_alias to include complete -e commands for clearing fish shell completions
e2e/cli/test_shell_alias_fish.fish Added new e2e test verifying that complete -e is emitted when setting and unsetting shell aliases in fish

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jdx jdx merged commit a9034d6 into main Feb 24, 2026
41 checks passed
@jdx jdx deleted the fix/fish-alias-completions branch February 24, 2026 03:20
@github-actions
Copy link

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.19 x -- echo 25.3 ± 0.3 24.8 28.0 1.00
mise x -- echo 25.8 ± 0.4 25.0 32.5 1.02 ± 0.02

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.19 env 24.1 ± 0.5 23.5 29.3 1.00
mise env 24.5 ± 0.4 23.8 26.0 1.02 ± 0.03

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.19 hook-env 24.8 ± 0.3 24.2 26.3 1.00
mise hook-env 25.2 ± 0.3 24.4 26.2 1.02 ± 0.02

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.19 ls 22.0 ± 0.2 21.5 22.8 1.00
mise ls 22.5 ± 0.3 21.9 25.9 1.02 ± 0.02

xtasks/test/perf

Command mise-2026.2.19 mise Variance
install (cached) 130ms 133ms -2%
ls (cached) 80ms 80ms +0%
bin-paths (cached) 84ms 85ms -1%
task-ls (cached) 784ms 790ms +0%

mise-en-dev added a commit that referenced this pull request Feb 25, 2026
### 🚀 Features

- **(conda)** replace custom backend with rattler crates by @jdx in
[#8325](#8325)
- **(task)** enforce per-task timeout configuration by @tvararu in
[#8250](#8250)
- **(vsix)** added vsix archives to http backend by @sosumappu in
[#8306](#8306)
- add core dotnet plugin for .NET SDK management by @jdx in
[#8326](#8326)

### 🐛 Bug Fixes

- **(conda)** preserve conda_packages on locked install and fix temp
file race by @jdx in [#8335](#8335)
- **(conda)** deduplicate repodata records to fix solver error on Linux
by @jdx in [#8337](#8337)
- **(env)** include watch_files in fast-path early exit check by @jdx in
[#8317](#8317)
- **(env)** clear fish completions when setting/unsetting shell aliases
by @jdx in [#8324](#8324)
- **(lockfile)** prevent lockfile writes when --locked is set by @jdx in
[#8308](#8308)
- **(lockfile)** prune orphan tool entries on mise lock by @mackwic in
[#8265](#8265)
- **(lockfile)** error on contradictory locked=true + lockfile=false
config by @jdx in [#8329](#8329)
- **(regal)** Update package location by @charlieegan3 in
[#8315](#8315)
- **(release)** strip markdown heading prefix from communique release
title by @jdx in [#8303](#8303)
- **(schema)** enforce additionalProperties constraint for env by
@adamliang0 in [#8328](#8328)

### 📚 Documentation

- Remove incorrect oh-my-zsh plugin ordering comment by @bvosk in
[#8323](#8323)
- require AI disclosure on GitHub comments by @jdx in
[#8330](#8330)

### 📦 Registry

- add `oxfmt` by @taoufik07 in
[#8316](#8316)

### New Contributors

- @adamliang0 made their first contribution in
[#8328](#8328)
- @tvararu made their first contribution in
[#8250](#8250)
- @bvosk made their first contribution in
[#8323](#8323)
- @taoufik07 made their first contribution in
[#8316](#8316)
- @charlieegan3 made their first contribution in
[#8315](#8315)
- @sosumappu made their first contribution in
[#8306](#8306)

## 📦 Aqua Registry Updates

#### New Packages (3)

- [`Tyrrrz/FFmpegBin`](https://github.com/Tyrrrz/FFmpegBin)
- [`elixir-lang/expert`](https://github.com/elixir-lang/expert)
- [`erikjuhani/basalt`](https://github.com/erikjuhani/basalt)

#### Updated Packages (5)

- [`caarlos0/fork-cleaner`](https://github.com/caarlos0/fork-cleaner)
-
[`firecow/gitlab-ci-local`](https://github.com/firecow/gitlab-ci-local)
- [`jackchuka/mdschema`](https://github.com/jackchuka/mdschema)
-
[`kunobi-ninja/kunobi-releases`](https://github.com/kunobi-ninja/kunobi-releases)
- [`peco/peco`](https://github.com/peco/peco)
risu729 pushed a commit to risu729/mise that referenced this pull request Feb 27, 2026
…jdx#8324)

## Summary
- Add `complete -e {name}` before `alias` in fish `set_alias` to clear
stale completions
- Add `complete -e {name}` before `functions -e` in fish `unset_alias`
to clean up leaked completions
- Add fish e2e test for alias completion management

Fixes jdx#8322

## Test plan
- [x] Existing `test_shell_alias` e2e tests pass (bash)
- [x] New `test_shell_alias_fish.fish` e2e test verifies `complete -e`
is emitted on both set and unset
- [x] Unit tests pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Fish-only shell hook output changes plus an e2e test; low blast radius
but could affect users relying on custom fish completions for alias
names.
> 
> **Overview**
> Updates fish alias management to proactively clear any existing
completions for the alias name by emitting `complete -e {name}` before
both setting (`alias ...`) and unsetting (`functions -e ...`) an alias.
> 
> Adds a new fish e2e test (`test_shell_alias_fish.fish`) that asserts
`mise hook-env -s fish --force` includes the completion cleanup lines on
alias creation and removal, preventing stale/leaked completions across
config changes.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
79eb19a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
risu729 pushed a commit to risu729/mise that referenced this pull request Feb 27, 2026
### 🚀 Features

- **(conda)** replace custom backend with rattler crates by @jdx in
[jdx#8325](jdx#8325)
- **(task)** enforce per-task timeout configuration by @tvararu in
[jdx#8250](jdx#8250)
- **(vsix)** added vsix archives to http backend by @sosumappu in
[jdx#8306](jdx#8306)
- add core dotnet plugin for .NET SDK management by @jdx in
[jdx#8326](jdx#8326)

### 🐛 Bug Fixes

- **(conda)** preserve conda_packages on locked install and fix temp
file race by @jdx in [jdx#8335](jdx#8335)
- **(conda)** deduplicate repodata records to fix solver error on Linux
by @jdx in [jdx#8337](jdx#8337)
- **(env)** include watch_files in fast-path early exit check by @jdx in
[jdx#8317](jdx#8317)
- **(env)** clear fish completions when setting/unsetting shell aliases
by @jdx in [jdx#8324](jdx#8324)
- **(lockfile)** prevent lockfile writes when --locked is set by @jdx in
[jdx#8308](jdx#8308)
- **(lockfile)** prune orphan tool entries on mise lock by @mackwic in
[jdx#8265](jdx#8265)
- **(lockfile)** error on contradictory locked=true + lockfile=false
config by @jdx in [jdx#8329](jdx#8329)
- **(regal)** Update package location by @charlieegan3 in
[jdx#8315](jdx#8315)
- **(release)** strip markdown heading prefix from communique release
title by @jdx in [jdx#8303](jdx#8303)
- **(schema)** enforce additionalProperties constraint for env by
@adamliang0 in [jdx#8328](jdx#8328)

### 📚 Documentation

- Remove incorrect oh-my-zsh plugin ordering comment by @bvosk in
[jdx#8323](jdx#8323)
- require AI disclosure on GitHub comments by @jdx in
[jdx#8330](jdx#8330)

### 📦 Registry

- add `oxfmt` by @taoufik07 in
[jdx#8316](jdx#8316)

### New Contributors

- @adamliang0 made their first contribution in
[jdx#8328](jdx#8328)
- @tvararu made their first contribution in
[jdx#8250](jdx#8250)
- @bvosk made their first contribution in
[jdx#8323](jdx#8323)
- @taoufik07 made their first contribution in
[jdx#8316](jdx#8316)
- @charlieegan3 made their first contribution in
[jdx#8315](jdx#8315)
- @sosumappu made their first contribution in
[jdx#8306](jdx#8306)

## 📦 Aqua Registry Updates

#### New Packages (3)

- [`Tyrrrz/FFmpegBin`](https://github.com/Tyrrrz/FFmpegBin)
- [`elixir-lang/expert`](https://github.com/elixir-lang/expert)
- [`erikjuhani/basalt`](https://github.com/erikjuhani/basalt)

#### Updated Packages (5)

- [`caarlos0/fork-cleaner`](https://github.com/caarlos0/fork-cleaner)
-
[`firecow/gitlab-ci-local`](https://github.com/firecow/gitlab-ci-local)
- [`jackchuka/mdschema`](https://github.com/jackchuka/mdschema)
-
[`kunobi-ninja/kunobi-releases`](https://github.com/kunobi-ninja/kunobi-releases)
- [`peco/peco`](https://github.com/peco/peco)
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.

2 participants