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

fix(bash): unbound variable error with STARSHIP_PREEXEC_READY #5438

Merged
merged 1 commit into from Oct 1, 2023

Conversation

hanoii
Copy link
Contributor

@hanoii hanoii commented Sep 13, 2023

I am installing starship on a Docker container, and every now and then I see the following:

/dev/fd/63: line 24: STARSHIP_PREEXEC_READY: unbound variable

On this particular use case I installed https://github.com/junegunn/fzf on the container and then running:

/opt/fzf/install --help just gives the above error. Not sure why it. doesn't happen to every command.

I figured this is because STARSHIP_PREEXEC_READY can be non existent at some point. Exporting STARSHIP_PREEXEC_READY=true in the terminal fixes it.

I propose to account for this scenario in the bash-init script.

EDIT: I made a script to easily reproduce this:

Obviously is the set -u that triggers it

#!/usr/bin/env bash

set -u

sleep 1

hanoii added a commit to hanoii/ddev-starship that referenced this pull request Sep 13, 2023
@chipbuster chipbuster self-assigned this Sep 14, 2023
Copy link
Contributor

@chipbuster chipbuster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@davidkna davidkna changed the title fix unbound variable error with STARSHIP_PREEXEC_READY fix(bash): unbound variable error with STARSHIP_PREEXEC_READY Oct 1, 2023
@davidkna davidkna merged commit 8168c21 into starship:master Oct 1, 2023
17 checks passed
@davidkna
Copy link
Member

davidkna commented Oct 1, 2023

Thanks for the fix @hanoii, and thanks for reviewing @chipbuster!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants