Open
Add Oh My Posh installer with bash, zsh, and fish shell configuration#473
Conversation
Copilot created this pull request from a session on behalf of
crramirez
August 3, 2026 19:00
View session
crramirez
marked this pull request as ready for review
August 3, 2026 19:02
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an Oh My Posh installer/uninstaller to the Pengwin Setup “Tools” menu, including bash completion wiring and a new shunit2 test to cover the new component.
Changes:
- Adds
pengwin-setup.d/oh-my-posh.shto install Oh My Posh and append shell init hooks. - Adds an uninstaller to remove the binary and clean shell init lines, plus menu/completion wiring.
- Adds a new shunit2 test and includes it in the default test run.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
pengwin-setup.d/oh-my-posh.sh |
New installer that downloads Oh My Posh and appends bash/zsh/fish init hooks. |
pengwin-setup.d/uninstall/oh-my-posh.sh |
New uninstaller that removes the binary and cleans init lines from shell configs. |
pengwin-setup.d/tools.sh |
Adds OHMYPOSH entry to the Tools menu and dispatches to the installer. |
pengwin-setup.d/uninstall.sh |
Adds OHMYPOSH entry to the uninstall menu and dispatches to the uninstaller. |
completions/pengwin-setup |
Adds OHMYPOSH to completion lists for TOOLS and UNINSTALL. |
tests/oh-my-posh.sh |
New test for install/uninstall behavior. |
tests/run_tests.sh |
Runs the new Oh My Posh test as part of the default suite. |
Comment on lines
+14
to
+17
| if ! curl -s https://ohmyposh.dev/install.sh | bash -s -- -d "${local_bin}"; then | ||
| echo "Failed to install Oh My Posh" >&2 | ||
| exit 1 | ||
| fi |
Comment on lines
+21
to
+41
| # Configure bash | ||
| if [[ -f "${HOME}/.bashrc" && $(grep -c 'oh-my-posh init bash' "${HOME}/.bashrc") == 0 ]]; then | ||
| echo "" >>"${HOME}/.bashrc" | ||
| echo "# Oh My Posh" >>"${HOME}/.bashrc" | ||
| echo "eval \"\$(oh-my-posh init bash)\"" >>"${HOME}/.bashrc" | ||
| fi | ||
|
|
||
| # Configure zsh | ||
| if [[ -f "${HOME}/.zshrc" && $(grep -c 'oh-my-posh init zsh' "${HOME}/.zshrc") == 0 ]]; then | ||
| echo "" >>"${HOME}/.zshrc" | ||
| echo "# Oh My Posh" >>"${HOME}/.zshrc" | ||
| echo "eval \"\$(oh-my-posh init zsh)\"" >>"${HOME}/.zshrc" | ||
| fi | ||
|
|
||
| # Configure fish | ||
| if [[ -d "${HOME}/.config/fish" && $(grep -c 'oh-my-posh init fish' "${HOME}/.config/fish/config.fish" 2>/dev/null) == 0 ]]; then | ||
| mkdir -p "${HOME}/.config/fish" | ||
| echo "" >>"${HOME}/.config/fish/config.fish" | ||
| echo "# Oh My Posh" >>"${HOME}/.config/fish/config.fish" | ||
| echo "oh-my-posh init fish | source" >>"${HOME}/.config/fish/config.fish" | ||
| fi |
Comment on lines
+5
to
+19
| function test_main() { | ||
| run_pengwinsetup install TOOLS OHMYPOSH | ||
|
|
||
| assertTrue "oh-my-posh binary not found" "[ -f ${HOME}/.local/bin/oh-my-posh ]" | ||
| assertTrue "oh-my-posh binary not executable" "[ -x ${HOME}/.local/bin/oh-my-posh ]" | ||
|
|
||
| run "${HOME}/.local/bin/oh-my-posh" --version | ||
| assertEquals "oh-my-posh version command failed" "0" "$?" | ||
| } | ||
|
|
||
| function test_uninstall() { | ||
| run_pengwinsetup install UNINSTALL OHMYPOSH | ||
|
|
||
| assertFalse "oh-my-posh binary still exists" "[ -f ${HOME}/.local/bin/oh-my-posh ]" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new installer for Oh My Posh, a prompt theme engine for any shell, accessible via the Tools menu.
New files
pengwin-setup.d/oh-my-posh.sh— installs via the official install script to~/.local/bin, then auto-configures each detected shellpengwin-setup.d/uninstall/oh-my-posh.sh— removes the binary and cleans up shell init linestests/oh-my-posh.sh— shunit2 test covering install and uninstallShell configuration (install)
Appends init hooks to whichever shell configs exist — skips if already configured:
Menu / completion wiring
tools.sh— addedOHMYPOSHentryuninstall.sh— addedOHMYPOSHentrycompletions/pengwin-setup— addedOHMYPOSHtoTOOLSandUNINSTALLcompletion liststests/run_tests.sh— test included in the default run