[Bug]: Liquidprompt (LP) theme has fallen out-of-sync with the Liquidprompt project
- Dominant language
- Shell
- Stars
- 15.2k
- Forks
- 2.3k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 2
Description
### Expected behavior
No errors; correct prompt when navigating VCS/Git repositories
### Current behavior
Missing `_lp_escape()` function; this occurs when working in Git repositories.
An error is shown every time the prompt is built i.e. every time you enter a command and hit .
It also manifests as only the Git commit hash being featured in the prompt; never the branch or tag name.
### Possible solution
My workaround at the moment is to amend the `themes/liquidprompt/liquidprompt.theme.bash` file:
- Update the project reference to [github.com/liquidprompt/liquidprompt](github.com/liquidprompt/liquidprompt)
- Delete (comment out) all Liquidprompt function overrides
### Context
I first became aware of this issue when my PS1 failed on `_lp_escape()` whenever I did anything in a Git repository - this was something I could ignore for only so long, and then took me forever to track down.
The `themes/liquidprompt/liquidprompt.theme.bash` file references an old Liquidprompt Github project URL i.e.
```
github.com/nojhan/liquidprompt
```
instead of
```
github.com/liquidprompt/liquidprompt
```
Further on in that theme file, there are LP function overrides that nolonger match (by name) what they once targeted; for example:
- [`_lp_git_branch()`](https://liquidprompt.readthedocs.io/en/stable/upgrading/v2.0.html#lp-git-branch) was renamed in LP to [`_lp_vcs_branch()`](https://liquidprompt.readthedocs.io/en/stable/functions/data/vcs.html#lp_vcs_branch)
- LP also shifted to an _output variable_ style, rather than printing results to stdout - with the expectation that that would be later captured - e.g. `branch="$(_lp_git_branch)"` no longer works
- [`_lp_escape()`](https://liquidprompt.readthedocs.io/en/stable/upgrading/v2.0.html#lp-escape) was renamed to [`__lp_escape`](https://liquidprompt.readthedocs.io/en/stable/functions/internal.html#lp_escape) i.e. made private (that is, it's now an unstable API)
- Similar return value vs stdout change as per `_lp_vcs_branch` mentioned above
- I am not sure what the situation is re: the `_lp_time()` and `_lp_temp_*()` function overrides are but. I have neither `sensors` nor `acpi` commands installed on my Mac to test with or talk about.
There is a fair amount going on in this theme file, by way of overrides and short-circuiting LP bits and pieces - more than I can comprehend - that I can not tell are still necessary or effective.
### Steps to reproduce
Presumably, enable the `liquidpormpt` theme i.e.
```
export BASH_IT_THEME=liquidprompt
```
### Diagnostic Information
```
└▪ bash-it doctor
Bash-it Doctor Summary
======================
## Environment
OS: Darwin 24.6.0
Bash Version: 5.3.8(1)-release
Bash-it Location: /Users/darren/.bash_it
Config File: /Users/darren/.bash_profile
## Bash-it Version
Current Version: v3.2.0 (0f04edce)
Status: 27 commits behind origin/master
Note: Cannot auto-update (uncommitted changes present). Use: bash-it update
## Bash-it Loading
## Profile Configuration
Note: /Users/darren/.bash_profile is a symlink to /Users/darren/bash_sync/bash_profile
Grep detection unclear, testing if .bashrc actually loads...
✗ .bashrc is NOT sourced from /Users/darren/.bash_profile
Warning: bash-it will not load in login shells (Terminal.app, SSH sessions)
Fix: Add the following to /Users/darren/.bash_profile:
if [ -n "$BASH_VERSION" ]; then
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
## Enabled Components
Aliases (8): ansible bash-it curl fuck git homebrew-cask homebrew kubectl
Plugins (19): aws base direnv docker-compose docker extract fzf git gitstatus hub java jekyll man osx-timemachine osx projects python ssh sudo
Completions (20): awscli bash-it brew defaults docker-compose docker git_flow_avh helm hub kubectl maven minikube pip pip3 projects sdkman ssh system tmux virtualbox
Tip: To copy this report: bash-it doctor | pbcopy (macOS) or xclip (Linux)
```
FYI, my `.bashrc` works just fine
### Additional Context (Optional)
_No response_
### Notes
_No response_
Contributor guide
Research direction
Start with themes/liquidprompt/liquidprompt.theme.bash and compare its Liquidprompt reference and function overrides with the current Liquidprompt API. Enable the liquidprompt theme, enter a Git repository, and reproduce the prompt error. Done means the theme builds without errors and displays the branch or tag as well as the commit hash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100