magicmonty / magicmonty/bash-git-prompt
overwrites existing $PROMPT_COMMAND
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 6.9k
- Forks
- 983
- Avg merge
- 13d 22h
- Merged PRs (30d)
- 2
Description
Sourcing gitprompt.sh replaces prompt command, not appends to it; following in ~/.bashrc:
$ echo "pre prompt: [$PROMPT_COMMAND]"
$ source "/installation/path/bash-git-prompt/gitprompt.sh"
$ echo "post prompt: [$PROMPT_COMMAND]"
...produces this:
pre prompt: [history -a]
post prompt: [setLastCommandState]
I would expect existing value to survive the import.
Running v 0bca406
Could this be the cause for issues like https://github.com/magicmonty/bash-git-prompt/issues/496?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with gitprompt.sh and reproduce the issue from ~/.bashrc using the echo-and-source commands in the report. Trace where PROMPT_COMMAND is assigned, then verify that an existing value such as history -a survives sourcing while the Git prompt still runs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100