Skip to content

Add Oh My Posh installer with bash, zsh, and fish shell configuration - #473

Open
crramirez with Copilot wants to merge 3 commits into
masterfrom
copilot/add-installer-for-oh-my-posh
Open

Add Oh My Posh installer with bash, zsh, and fish shell configuration#473
crramirez with Copilot wants to merge 3 commits into
masterfrom
copilot/add-installer-for-oh-my-posh

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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 shell
  • pengwin-setup.d/uninstall/oh-my-posh.sh — removes the binary and cleans up shell init lines
  • tests/oh-my-posh.sh — shunit2 test covering install and uninstall

Shell configuration (install)

Appends init hooks to whichever shell configs exist — skips if already configured:

# ~/.bashrc / ~/.zshrc
eval "$(oh-my-posh init bash)"   # or zsh
# ~/.config/fish/config.fish (only if fish config dir exists)
oh-my-posh init fish | source

Menu / completion wiring

  • tools.sh — added OHMYPOSH entry
  • uninstall.sh — added OHMYPOSH entry
  • completions/pengwin-setup — added OHMYPOSH to TOOLS and UNINSTALL completion lists
  • tests/run_tests.sh — test included in the default run

@crramirez
crramirez marked this pull request as ready for review August 3, 2026 19:02
Copilot AI review requested due to automatic review settings August 3, 2026 19:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.sh to 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 thread pengwin-setup.d/oh-my-posh.sh Outdated
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 thread tests/oh-my-posh.sh
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 ]"
}
Copilot AI requested a review from crramirez August 3, 2026 19:15
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.

3 participants