inshellisense icon indicating copy to clipboard operation
inshellisense copied to clipboard

Does not work with starship prompt

Open TuomasAutio opened this issue 1 year ago • 6 comments

Describe the bug When using the inshellisense plugin in conjunction with the Starship prompt in a Zsh shell, the inshellisense plugin fails to work as expected. Specifically, it does not give suggestions when starship is active

To Reproduce Steps to reproduce the behavior:

  1. Configure inshellisense in your .zshrc file.
  2. Install and configure the Starship prompt in the same .zshrc file.
  3. Open a new terminal session.
  4. See that it does not work

Expected behavior Drop down auto suggestions

Environment

  • OS: macOS Sonoma
  • Output of 0.0.1-rc.15
  • Nodejs Version: v22.0.0
  • Shell: zsh
  • Shell Version: 5.9

Additional context Probably conflicts with the hooks used by the Starship prompt (e.g., precmd and preexec)

TuomasAutio avatar May 30 '24 12:05 TuomasAutio

This also happens to me, but in this case, It's ble.sh, Without ble.sh: image With ble.sh: image

dmgnr avatar Jun 01 '24 18:06 dmgnr

Do you think it is related to the right prompt? How about the behavior without the right prompt?

akinomyoga avatar Jun 01 '24 19:06 akinomyoga

image Oh yeah, It started working again after I disabled right prompt

dmgnr avatar Jun 02 '24 03:06 dmgnr

Then, I think inshellisense is confused by the existence of the right prompt. I searched in the repository for "right prompt", but nothing seems to be mentioned, so I think inshellisense doesn't just support shell settings with right prompts for now.

akinomyoga avatar Jun 02 '24 03:06 akinomyoga

I added this original to handle right prompts, which I'd expect to get triggered here. I think there are outstanding issues with zsh that might be contributing this as well (outside of the right prompt issue the bash users are experiencing) https://github.com/microsoft/inshellisense/blob/1a309c8104ee92d5fff2e16f689db0372796a788/src/isterm/commandManager.ts#L242

cpendery avatar Jun 03 '24 21:06 cpendery

@superdinmc how did you get it to play nicely with blesh? blesh seems to override it's bindings and just do up/down command history even when the inshellisense popup is open.

NireBryce avatar Jul 06 '24 02:07 NireBryce

@TuomasAutio, I can't replicate this currently with 0.0.1-rc.15 with zsh 5.8.1 (I am on ubuntu though). My .zshrc looks like this

# ---------------- inshellisense shell plugin ----------------
if [[ -z "${ISTERM}" && $- = *i* && $- != *c* ]]; then
  if [[ -o login ]]; then
    is -s zsh --login ; exit
  else
    is -s zsh ; exit
  fi
fi

# ---------------- startship plugin ----------------
eval "$(starship init zsh)"

Can you send your .zshrc here along along with the logs at ~/.inshellisense/inshellisense.log after starting inshellisense and running 1 command with the -v flag?

cpendery avatar Oct 25 '24 02:10 cpendery

Can you send your .zshrc here along along with the logs at ~/.inshellisense/inshellisense.log after starting inshellisense and running 1 command with the -v flag?

Same for you @superdinmc, I'll try to reproduce with ble.sh after

cpendery avatar Oct 25 '24 02:10 cpendery

It's been months since I tried to use inshellisense on blesh but I will follow-up with the .bashrc ASAP.

There's also starship configuration, I will also have it here.

dmgnr avatar Oct 25 '24 10:10 dmgnr

It's been months since I tried to use inshellisense on blesh but I will follow-up with the .bashrc ASAP.

There's also starship configuration, I will also have it here.

Sorry for the long silence on the issues, I haven't been able to work on it for a while. The project should get more attention moving forward

cpendery avatar Oct 25 '24 15:10 cpendery

.bashrc starship.toml

GitHub wouldn't let me upload the files and I lost access to my main domain so I'm using Tixte subdomain temporarily(and cloudflare went down when I tried to set it up with the new domain...).

dmgnr avatar Oct 31 '24 01:10 dmgnr

.bashrc starship.toml

GitHub wouldn't let me upload the files and I lost access to my main domain so I'm using Tixte subdomain temporarily(and cloudflare went down when I tried to set it up with the new domain...).

You can just drop them into some code blocks like below, my network won't let me download the files.

# .bashrc

export PS1='>'

cpendery avatar Nov 04 '24 17:11 cpendery

I think this should be fixed in the most recent changes that will be released in 0.0.1-rc.17. You'll need to run is doctor and make any of the changes it recommends, but that should fix any configuration issues. Will reopen if it continues to be an issue in the future

cpendery avatar Nov 07 '24 03:11 cpendery

@cpendery Thank you for taking the time to fix the issue! Does the fix also cover the case with ble.sh reported by @superdinmc and @NireBryce (as well as the original case with Starship)?

akinomyoga avatar Nov 07 '24 03:11 akinomyoga

@cpendery Thank you for taking the time to fix the issue! Does the fix also cover the case with ble.sh reported by @superdinmc and @NireBryce (as well as the original case with Starship)?

@akinomyoga it should fix it, but please feel free to give it a retry once I do the release. I wasn't able to consistently replicate the behavior so I'm hopeful but not confident that it's fixed

cpendery avatar Nov 07 '24 04:11 cpendery

Thanks!

@akinomyoga it should fix it, but please feel free to give it a retry once I do the release. I wasn't able to consistently replicate the behavior so I'm hopeful but not confident that it's fixed

OK, then I'll ask the users @superdinmc and @NireBryce about whether the issue is fixed in their environments. I'm just the author of ble.sh and not an Inshellisense user who experienced the issue. I received Issue https://github.com/akinomyoga/ble.sh/issues/464 in my project from @NireBryce so wanted to know the status.

akinomyoga avatar Nov 07 '24 05:11 akinomyoga