microsoft / inshellisense

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

Inshellisense with oh-my-bash stops working after the first executed command #201

Closed whiskeyo closed 3 months ago

whiskeyo commented 3 months ago

Describe the bug While entering the first command, the window with suggestion appears. Once I pick any subcommand/flag, it turns off and does not work for the next input. After inshellisense started working with this fix: https://github.com/microsoft/inshellisense/pull/200, it turned out that it worked just for a single command.

To Reproduce Steps to reproduce the behavior:

  1. Install oh-my-bash and latest inshellisense (9907244548ee0a2a5890206cdf060bf1e7b5c065)
  2. Write the part of the first command, the window with suggestion appears, select any of these, press enter to call it.
  3. Write another command, this time the window does not appear anymore.

Expected behavior Inshellisense should support all commands when the session is live.

Environment

Additional context I recorded a small sample and uploaded it on YouTube to make it easier to get what's happening, here's the link: https://youtu.be/L30cOTPP14E

cpendery commented 3 months ago

For reference, this is what I think is happening:

I have setup hooks to inject the inshellisense prompt bytes into the prompt for every case except for when a $PROMPT_COMMAND decides to re-write $PS1 after the precmd hook is triggered.

I've tested the fix and it's working for multiple command executions.

cpendery commented 3 months ago

@whiskeyo let me know if you run into any other issues