Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completion doesn't work by default when program has an exe extension #2565

Open
3 of 12 tasks
mcexit opened this issue Oct 24, 2024 · 0 comments
Open
3 of 12 tasks

Completion doesn't work by default when program has an exe extension #2565

mcexit opened this issue Oct 24, 2024 · 0 comments
Labels
bug Something isn't working fund Fundable with polar.sh nushell powershell windows

Comments

@mcexit
Copy link

mcexit commented Oct 24, 2024

Current Behavior

By default PowerShell tab completion for executables adds a .exe extension, but carapace expects programs to not have have an extension to lazy load the completions. I was able to work around this by modifying the init script:

Invoke-Expression -Command (Out-String -InputObject (carapace.exe _carapace 'powershell')).Replace('$commandAst.CommandElements[0].Value', 'Split-Path -LeafBase -Path "$($commandAst.CommandElements[0].Value)"')

Expected Behavior

I'd expect the carapace init script to complete executables with and without the 'exe' extension by default.

Steps To Reproduce

  1. Use the default init script (carapace.exe _carapace powershell).
  2. Try tab completing a program that has a completer using the .exe extension (bat.exe).
  3. Now, remove the .exe extension and tab completion works.
  4. After it loads the completer, now completion works for the '.exe' extension when it didn't before.

Version

1.0.7

OS

  • Darwin
  • Linux
  • Termux
  • Windows

Shell

  • Bash
  • Elvish
  • Fish
  • Nushell
  • Oil
  • Powershell
  • Xonsh
  • Zsh

Anything else?

No response

Polar

Fund with Polar
@mcexit mcexit added bug Something isn't working fund Fundable with polar.sh labels Oct 24, 2024
@mcexit mcexit changed the title <command>: <title> Completion doesn't work by default when program has an exe extension Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fund Fundable with polar.sh nushell powershell windows
Projects
None yet
Development

No branches or pull requests

1 participant