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

Does not work with starship prompt #262

Open
TuomasAutio opened this issue May 30, 2024 · 12 comments
Open

Does not work with starship prompt #262

TuomasAutio opened this issue May 30, 2024 · 12 comments
Labels
bug Something isn't working
Milestone

Comments

@TuomasAutio
Copy link

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 TuomasAutio added the bug Something isn't working label May 30, 2024
@superdinmc
Copy link

superdinmc commented Jun 1, 2024

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

@akinomyoga
Copy link

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

@superdinmc
Copy link

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

@akinomyoga
Copy link

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.

@cpendery
Copy link
Member

cpendery commented Jun 3, 2024

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)

if (postCursorCommand.endsWith(" ")) break; // assume that a command that ends with 4 spaces is terminated, avoids capturing right prompts

@NireBryce
Copy link

NireBryce commented Jul 6, 2024

@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.

@cpendery
Copy link
Member

@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
Copy link
Member

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

@superdinmc
Copy link

superdinmc commented Oct 25, 2024

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.

@cpendery
Copy link
Member

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

@superdinmc
Copy link

.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...).

@cpendery
Copy link
Member

cpendery commented Nov 4, 2024

.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='>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants