Skip to content

PowerShell shell integration is not working #885

Closed

Description

@DiTo97

git-wt switch --create fuzzy-matching

✓ Created branch fuzzy-matching from main and worktree @ 'C:/Users/f.minutoli/Desktop/WS/atenareply/tokenprice.fuzzy-matching'
▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install

git-wt config shell install

❯ Install shell integration? [y/N/?] y

✓ Added shell extension for powershell @ ~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1
↳ Skipped bash; ~/.bashrc not found
↳ Skipped zsh; ~/.zshrc not found
↳ Skipped fish; ~/.config/fish/functions not found

✓ Configured 1 shell

git-wt config show

USER CONFIG  ~/AppData/Roaming/worktrunk/config.toml
↳ Not found; to create one, run wt config create

PROJECT CONFIG  'C:/Users/f.minutoli/Desktop/WS/atenareply/tokenprice/.config/wt.toml'
↳ Not found

SHELL INTEGRATION
▲ Shell integration not active
  Invoked as:
  C:\Users\f.minutoli\AppData\Local\Microsoft\WinGet\Packages\max-sixty.worktrunk_Microsoft.Winget.Source_8wekyb3d8bbwe\git-wt.exe

○ powershell: Already configured shell extension & completions @ ~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1:2
  if (Get-Command git-wt -ErrorAction SilentlyContinue) { Invoke-Expression (& git-wt config shell init powershell) }
○ bash: Skipped; ~/.bashrc not found
○ zsh: Skipped; ~/.zshrc not found
○ fish: Skipped; ~/.config/fish/functions not found

CLAUDE CODE
○ claude CLI not installed

OTHER
○ git-wt: v0.20.1
○ git: 2.52.0.windows.1
○ Hyperlinks: active

cat ~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1


if (Get-Command git-wt -ErrorAction SilentlyContinue) { Invoke-Expression (& git-wt config shell init powershell) }

git-wt switch fuzzy-matching

▲ Worktree for fuzzy-matching @ 'C:/Users/f.minutoli/Desktop/WS/Atena Reply/tokenprice.fuzzy-matching', but cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install

Activity

  1. max-sixty commented on Jan 27, 2026

    @max-sixty
    Owner

    (looking into this; it may be Powershell versions, either try running the below or will release something to wt config show so we get this for free

    
      $PSVersionTable.PSVersion   # Check PowerShell version
      $PROFILE                    # Check which profile is loaded
    

    )

  2. DiTo97 commented on Jan 27, 2026

    @DiTo97
    Author

    $PSVersionTable.PSVersion

    Major  Minor  Patch  PreReleaseLabel BuildLabel
    -----  -----  -----  --------------- ----------
    7      5      4
    

    $PROFILE

    %userprofile%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
    
  3. max-sixty commented on Jan 28, 2026

    @max-sixty
    Owner

    I think it's fixed; check out 0.20.2 and see whether that works; will require a wt config shell install and a shell restart; let me know

    thank you for the issue!

  4. micheltol commented on Jan 28, 2026

    @micheltol

    Hi @max-sixty ,
    for me the version 0.20.2 hasn't resolved this issue yet .

    PS D:\> git-wt -V
    wt v0.20.2
    PS D:\> git-wt config shell install
    ↳ Skipped bash; ~/.bashrc not found
    ↳ Skipped zsh; ~/.zshrc not found
    ↳ Skipped fish; ~/.config/fish/functions not found
    ↳ Skipped powershell; ~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 not found
    ✗ No shell config files found
    PS D:\> git-wt config show
    USER CONFIG  ~/AppData/Roaming/worktrunk/config.toml
    ↳ Not found; to create one, run wt config create
    
    PROJECT CONFIG  Not in a git repository
    
    SHELL INTEGRATION
    ▲ Shell integration not active
      Invoked as: C:\Users\michel.<DOMAIN-NAME>\.cargo\bin\git-wt.exe
    
    ○ bash: Skipped; ~/.bashrc not found
    ○ zsh: Skipped; ~/.zshrc not found
    ○ fish: Skipped; ~/.config/fish/functions not found
    ○ powershell: Skipped; ~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 not found
    
    CLAUDE CODE
    ↳ Plugin not installed. To install, run:
      claude plugin marketplace add max-sixty/worktrunk
      claude plugin install worktrunk@worktrunk
    ↳ Statusline not configured. See https://worktrunk.dev/claude-code/#statusline
    
    OTHER
    ○ git-wt: v0.20.2
    ○ git: 2.52.0.windows.1
    ○ Hyperlinks: active
    
    PS D:\> $PSVersionTable.PSVersion
    
    Major  Minor  Patch  PreReleaseLabel BuildLabel
    -----  -----  -----  --------------- ----------
    7      5      4
    
    PS D:\> $PROFILE
    C:\Users\michel.<DOMAIN-NAME>\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
    PS D:\>
    
    

    If you need more info please let me know :)

  5. max-sixty commented on Jan 28, 2026

    @max-sixty
    Owner

    (claude created a couple of comments without my permission, which I deleted, apologies)

  6. max-sixty commented on Jan 29, 2026

    @max-sixty
    Owner

    I think the issue is that the file wasn't created. would you mind trying with 0.20.3?

    (60% chance to work! appreciate your patience)

  7. 20 remaining items

  8. max-sixty commented on Feb 12, 2026

    @max-sixty
    Owner

    (sorry that claude keeps marking the PRs as closing this issue, will fix)

    Thanks @DiTo97. so it seems there is a powershell function... could you run a couple more diagnostics in the same PowerShell session?

    1. Check if the wrapper sets the right env var:

      (Get-Command git-wt -CommandType Function).ScriptBlock | Select-String WORKTRUNK
    2. Check what binary the wrapper resolves to:

      Get-Command git-wt -CommandType Application | Select-Object Source
    3. Run git-wt switch through the wrapper and check if the directive file was set:

      git-wt switch <some-branch>
      echo $env:WORKTRUNK_DIRECTIVE_FILE

    Alternatively, if you have claude installed, you can install the worktrunk plugin and ask it to help debug:

    claude plugin marketplace add max-sixty/worktrunk
    claude plugin install worktrunk@worktrunk
    
  9. DiTo97 commented on Feb 15, 2026

    @DiTo97
    Author

    Hi @max-sixty, I'm testing v0.24.0.

    git-wt config show still prints some warnings:

    USER CONFIG  ~/AppData/Roaming/worktrunk/config.toml
    ↳ Not found; to create one, run wt config create
    
    PROJECT CONFIG  ~/Desktop/WS/personal/testwt/.config/wt.toml
    ↳ Not found
    
    SHELL INTEGRATION
    ○ Shell integration active
    
    ○ powershell: Already configured shell extension & completions @ ~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1:2
      if (Get-Command git-wt -ErrorAction SilentlyContinue) { Invoke-Expression (& git-wt config shell init powershell |
      Out-String) }
    ○ bash: Skipped; ~/.bashrc not found
    ○ zsh: Skipped; ~/.zshrc not found
    ○ fish: Skipped; ~/.config/fish/functions not found
    ○ nu: Skipped; ~/AppData/Roaming/nushell/vendor/autoload not found
    
    CLAUDE CODE
    ○ claude CLI not installed
    
    OTHER
    ○ git-wt: v0.24.0
    ○ git: 2.53.0.windows.1
    ○ Hyperlinks: active
    0
    

    yet worktree creation seems to be working. I will share the full log. Despite that, I'm getting some git warnings.

    >>> git init testwt
    Initialized empty Git repository in C:/Users/f.minutoli/Desktop/WS/personal/testwt/.git/
    
    >>> cd .\testwt
    
    >>> git-wt list
     Branch  Status        HEAD±    main↕  Path  Remote⇅  Commit    Age   Message
    @ master      ^                         .              00000000  56y
    
    ○ Showing 1 worktree. 4 tasks failed
    ▲ Some git operations failed:
      master: commit-details (fatal: bad object 0000000000000000000000000000000000000000)
      master: ahead-behind (git merge-base failed for master 0000000000000000000000000000000000000000: fatal: Not a valid
      object name master)
      master: committed-trees-match (fatal: ambiguous argument '0000000000000000000000000000000000000000^{tree}': unknown
      revision or path not in the working tree.)
      master: has-file-changes (git merge-base failed for master master: fatal: Not a valid object name master)
    ↳ To create a diagnostic file, run with -vv
    0
    
    >>>  git-wt switch master
    ▲ Branch-worktree mismatch; expected master @ ~/Desktop/WS/personal/testwt.master ⚑
    ○ Already on worktree for master @ ~/Desktop/WS/personal/testwt
    0
    
    >>> git-wt switch test --create
    ▲ Configured default branch master does not exist locally
    ↳ To reset, run wt config state default-branch clear
    ✓ Created branch test and worktree @ ~/Desktop/WS/personal/testwt.test
    ↳ To customize worktree locations, run wt config create
    0
    
    >>> echo $env:WORKTRUNK_DIRECTIVE_FILE
    
    >>> git-wt switch master
    ▲ Branch-worktree mismatch; expected master @ ~/Desktop/WS/personal/testwt.master ⚑
    ○ Switched to worktree for master @ ~/Desktop/WS/personal/testwt
    0
    
    >>> git-wt list --branches --remotes
    ▲ Configured default branch master does not exist locally
    ↳ To reset, run wt config state default-branch clear
      Branch  Status        HEAD±    main↕  Path            Remote⇅  Commit    Age   Message
    @ master  ⋯                             .                        00000000  56y
    + test    ⋯                             ..\testwt.test           00000000  56y
    
    >>> git-wt remove test -D
    ◎ Removing test worktree in background
    ↳ Branch unmerged; to delete, run wt remove test -D
    0
    
    >>> git-wt list --branches --remotes
    ▲ Configured default branch master does not exist locally
    ↳ To reset, run wt config state default-branch clear
      Branch  Status        HEAD±    main↕  Path  Remote⇅  Commit    Age   Message
    @ master  ⋯                             .              00000000  56y
    
    ○ Showing 1 worktrees. 1 task failed
    ▲ Some git operations failed:
      master: commit-details (fatal: bad object 0000000000000000000000000000000000000000)
    ↳ To create a diagnostic file, run with -vv
    0
    
    >>> Get-Command git-wt
    CommandType     Name                                               Version    Source
    -----------     ----                                               -------    ------
    Function        git-wt
    
  10. max-sixty commented on Feb 16, 2026

    @max-sixty
    Owner

    I think that's a repo with no commits, which we should handle much better; I'll make the fix.

    But it looks like the powershell integration is working? great if so!

  11. added 3 commits that reference this issue on Feb 16, 2026
    569fc46
    2088efe
    516f90b
  12. added a commit that references this issue on Feb 16, 2026
    bb3efee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions