microsoft / inshellisense

IDE style command line auto complete
MIT License
8.21k stars 179 forks source link

No GUI in Windows Terminal Powershell 7 (pwsh) #249

Closed ItsIgnacioPortal closed 1 month ago

ItsIgnacioPortal commented 2 months ago

Describe the bug The autocomplete shows a single suggestion and no GUI when using inshellisense in powershell 7 (pwsh):

powershell 7

In comparison, this is what it does in the old powershell:

old powershell

To Reproduce Steps to reproduce the behavior:

  1. Install inshellisense 0.0.1-rc.14 (latest version as of writing this)
  2. Open a powershell 7 shell: "C:\Program Files\PowerShell\7\pwsh.exe" -nologo -ep bypass
  3. Start inshellisense: is
  4. Try to use the inshellisense autocomplete. The GUI won't show up for any git commands.

Expected behavior I expected the GUI to show up and allow me to select from multiple suggestions.

Environment

cpendery commented 2 months ago

@ItsIgnacioPortal can you provide the log files for the first image? You can run is -s pwsh -V and then paste the log files from ~/.inshellisense/inshellisense.log

ItsIgnacioPortal commented 2 months ago

I've noticed that if I run pwsh.exe directly from the Run dialog, then cd into my user profile and then start inshellisense, the GUI does show up, albeit with the icons not loading correctly:

inshellisense in pwsh exe

For testing, this is my Windows Terminal settings.json: https://gist.github.com/ItsIgnacioPortal/f1e7fb49f45794e7c3f13295b32a872a This is the font I use in all my Windows Terminal profiles: CaskaydiaCove NFM

So, let's recap:

Why is this ocurring?

cpendery commented 2 months ago

@itsignacioPortal can you retry using the most recent release 0.0.1-rc.15? It might fix your issues or at a minimum provide more information in the log files

ItsIgnacioPortal commented 2 months ago

I've installed IS 0.0.1-rc.15 but the problem seems to have persisted. Visually, it looks the same:

image

These are the IS logs in the new version (inshellisense v0.0.1-rc.15):

cpendery commented 1 month ago

Looking at the logs with pwsh, it's saying your cursor is at PS C:\\Users\\User\\Github\\SecLists> git █push. Is push a suggestion from the shell? If so, that's definitely the issue and I can fix that.

cpendery commented 1 month ago

Once I merge #253 into main, you can install using this command to make sure it's working ahead of the next release

npm uninstall @microsoft/inshellisense -g && git clone https://github.com/microsoft/inshellisense.git && cd inshellisense && npm install && npm run build && npm link
ItsIgnacioPortal commented 1 month ago

Looking at the logs with pwsh, it's saying your cursor is at PS C:\\Users\\User\\Github\\SecLists> git █push. Is push a suggestion from the shell? If so, that's definitely the issue and I can fix that.

Yes, push was a suggestion from the shell.

Once I merge #253 into main, you can install using this command to make sure it's working ahead of the next release

npm uninstall @microsoft/inshellisense -g && git clone https://github.com/microsoft/inshellisense.git && cd inshellisense && npm install && npm run build && npm link

That worked! The auto-completion is now working in the normal Powershell 7. But I need it to work in Powershell 7 with oh-my-posh. Do you know how I could do that?

(Yes, I have hello as my terminal suffix in oh-my-posh)

This is my oh-my-posh prompt: https://gist.github.com/ItsIgnacioPortal/176a07b7ecb18bc9fda7531e1655fd13

cpendery commented 1 month ago

The issue isn't your hello suffix, it's the way we parse the prompt terminator. You have the console_title_template set which appends to the end of your prompt. As a result, the prompt end is detected as the resolved {.HostName} instead of hello

cpendery commented 1 month ago

Can you try out the latest commit and let me know if it's working for you now?

ItsIgnacioPortal commented 1 month ago

That fix worked! Thank you.