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

Resetting PROMPT_START/PROMPT_END on exit #547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bradmwilliams
Copy link

/fixes #539

The issue seems to be caused by the logic here:

# Do this only once to define PROMPT_START and PROMPT_END
if [[ -z "${PROMPT_START:+x}" || -z "${PROMPT_END:+x}" ]]; then
if [[ -z "${GIT_PROMPT_START:+x}" ]] ; then
if ${_isroot}; then
PROMPT_START="${GIT_PROMPT_START_ROOT-}"
else
PROMPT_START="${GIT_PROMPT_START_USER-}"
fi
else
PROMPT_START="${GIT_PROMPT_START-}"
fi
if [[ -z "${GIT_PROMPT_END:+x}" ]] ; then
if $_isroot; then
PROMPT_END="${GIT_PROMPT_END_ROOT-}"
else
PROMPT_END="${GIT_PROMPT_END_USER-}"
fi
else
PROMPT_END="${GIT_PROMPT_END-}"
fi
fi

Basically, the values of both PROMPT_START and PROMPT_END are being set accordingly when entering a git repository, but never being reset to their original values upon exiting.

This PR adds a couple lines to capture the original values of PROMPT_START and PROMPT_END on the way in and then resets the values accordingly on the way out.

@bradmwilliams
Copy link
Author

Similar findings to #542.

@praveenkumar
Copy link

Tested on F-39 and it works as expected.

@Dylan-M
Copy link

Dylan-M commented Mar 22, 2024

This is also working for me. I hope this gets merged soon, as it is better than #542, since it handles both start AND end.

@GaLaKtIkUs
Copy link

Hello. This is working for me. Hope it will be merged.

@bradmwilliams
Copy link
Author

bradmwilliams commented Apr 25, 2024

/fixes #548
/fixes #550

@msantacruzd
Copy link

It worked for me also, tested on Fedora 39

@Dylan-M
Copy link

Dylan-M commented May 15, 2024

Yeah, at this point the fix has been verified. We just need it to actually get merged by @magicmonty ;)

Hopefully soon, but in the meantime I just keep manually applying the fix as needed on my systems.

@ghjm
Copy link

ghjm commented May 18, 2024

I can confirm this worked for me on Fedora 40.

@ddreggors
Copy link

I can also confirm this works for me on Fedora 40

@joelapatatechaude
Copy link

Works for me too on Fedora 40

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.

Prompt shows "_LAST_COMMAND_INDICATOR_" when leaving git repo
8 participants