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

carapace _caraspace | Out-String | Invoke-Expression #2409

Open
2 of 12 tasks
pa-0 opened this issue Jun 11, 2024 · 4 comments
Open
2 of 12 tasks

carapace _caraspace | Out-String | Invoke-Expression #2409

pa-0 opened this issue Jun 11, 2024 · 4 comments
Labels
bug Something isn't working powershell windows

Comments

@pa-0
Copy link

pa-0 commented Jun 11, 2024

Current Behavior

When PowerShell attempts to load the default $PROFILE, the following error is returned:

expected one of 'bash', 'bash-ble', 'elvish', 'export', 'fish', 'ion', 'nushell', 'oil', 'powershell', 'tcsh', 'xonsh', 'zsh' [was: ]
Invoke-Expression: C:\Users\XXXX\Documents\PowerShell\Microsoft.PowerShell_profile.ps1:266
Line |
 266 |  carapace _carapace | Out-String | Invoke-Expression
     |                                    ~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'Command' because it is an empty string.
Loading personal and system profiles took 24758ms.

Expected Behavior

The $PROFILE loads correctly.

Steps To Reproduce

  1. Follow carapace setup instructions exactly after running winget install from Admin prompt.
  2. Copy and paste code block into default "...PowerShell_profile.ps1" file.
  3. Run PowerShell.

Version

7.5.0-preview.3

OS

  • Linux
  • OSX
  • Termux
  • Windows

Shell

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

Anything else?

~/.config/powershell/Microsoft.PowerShell_profile.ps1

$env:CARAPACE_BRIDGES = 'zsh,fish,bash,inshellisense' # optional
Set-PSReadLineOption -Colors @{ "Selection" = "`e[7m" }
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
carapace _carapace | Out-String | Invoke-Expression


And now that I'm reading it, I'm thinking that optional line does not apply since I do not have zsh, fish or inshellisense installed. 🤦🏽‍♂️ 
@pa-0 pa-0 added the bug Something isn't working label Jun 11, 2024
@pa-0
Copy link
Author

pa-0 commented Jun 11, 2024

I take that back, removing the optional line makes no difference.

@rsteube
Copy link
Member

rsteube commented Jun 11, 2024

Does this work?

carapace _carapace powershell | Out-String | Invoke-Expression

@rsteube
Copy link
Member

rsteube commented Jun 11, 2024

Oh and are you on a recent Powershell 7 version?

@pa-0
Copy link
Author

pa-0 commented Jun 12, 2024

Yes. Newest preview release.

@rsteube rsteube changed the title caraspace _caraspace | Out-String | Invoke-Expression carapace _caraspace | Out-String | Invoke-Expression Jul 21, 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 powershell windows
Projects
None yet
Development

No branches or pull requests

2 participants