Skip to content

Prevent nushell source contamination in install shell loop#4812

Merged
junegunn merged 2 commits into
masterfrom
copilot/bug-fix-install-script-fish-config
May 28, 2026
Merged

Prevent nushell source contamination in install shell loop#4812
junegunn merged 2 commits into
masterfrom
copilot/bug-fix-install-script-fish-config

Conversation

Copilot AI commented May 28, 2026

Copy link
Copy Markdown
Contributor

When both fish and nushell are detected, the install loop could carry over previously assigned fzf_completion / fzf_key_bindings values and write a nushell source line into fish config in partial-enable flows (key bindings only or completion only).

  • Root cause

    • nushell was skipped after shell-specific source variables were assigned, allowing stale values to leak into later fish update logic.
  • Change

    • Reordered loop control in install so nushell is skipped immediately at loop entry, before assigning:
      • fzf_completion
      • fzf_key_bindings
    • This keeps fish/bash/zsh variable values shell-correct and avoids cross-shell contamination.
  • Code snippet

    for shell in $shells; do
      [[ $shell == nushell ]] && continue
      fzf_completion="source \"$fzf_base/shell/completion.${shell}\""
      fzf_key_bindings="source \"$fzf_base/shell/key-bindings.${shell}\""
      [[ $shell == fish ]] && continue
      ...
    done

Copilot AI changed the title [WIP] Fix install script key-bindings and completions in Fish config Prevent nushell source contamination in install shell loop May 28, 2026
Copilot AI requested a review from junegunn May 28, 2026 00:35
@github-actions github-actions Bot added the install Install/uninstall scripts label May 28, 2026
@junegunn junegunn requested a review from Copilot May 28, 2026 01:14
@junegunn junegunn marked this pull request as ready for review May 28, 2026 01:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Reorders the nushell skip in the install script's shell loop so that nushell is bypassed before the fish-shared fzf_completion / fzf_key_bindings variables are assigned. This prevents stale nushell-derived values (e.g., paths ending in .nushell) from leaking into fish partial-enable flows that reuse those variables outside the loop.

Changes:

  • Move [[ $shell == nushell ]] && continue above the assignments to fzf_completion and fzf_key_bindings in install.

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

@junegunn junegunn merged commit 5ef8dea into master May 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

install Install/uninstall scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: install script incorrectly sources Nushell key-bindings or completions into Fish configuration

3 participants