Skip to content

Conversation

@maxrantil
Copy link
Owner

Summary

Fixes VM usability issues: gruvbox errors, starship warnings, and missing browser for gh CLI.

Problems Fixed

1. Gruvbox Colorscheme Error

Issue: init.vim tries to load gruvbox but it's not installed in minimal VM setups
Error: Vim shows colorscheme error on every startup
Fix: Disabled gruvbox plugin for VM setups (uses vim's default colorscheme)

2. Starship Git Status Warnings

Issue: Starship shows format string errors in git repos:
```
[WARN] - (starship::modules::git_status): Error parsing format string `git_status.stashed`
[WARN] - (starship::modules::git_status): Error parsing format string `git_status.untracked`
[WARN] - (starship::modules::git_status): Error parsing format string `git_status.modified`
```
Fix: Added `${count}` placeholder consistently to all git_status format strings

3. Browser Not Found (gh CLI)

Issue: gh CLI fails with:
```
! Failed opening a web browser at https://github.com/login/device
exec: "firefox": executable file not found in $PATH
```
Root Cause: BROWSER was hardcoded to `firefox` but VMs don't have it installed
Fix: Auto-detect available browser with priority:

  1. chromium-browser (lightweight, good for VMs)
  2. firefox
  3. chromium
  4. xdg-open (fallback)

Changes

  • init.vim: Commented out gruvbox plugin and settings for minimal VM setup
  • starship.toml: Fixed git_status format strings to use `${count}` consistently
  • .zshenv: Changed BROWSER from hardcoded to auto-detected

Testing

✅ init.vim: No errors on vim startup
✅ starship: No warnings in git repositories
✅ BROWSER: Auto-detects available browser

VM Setup Notes

For gh CLI to work with browser in VMs:

  1. Install chromium-browser:
    ```bash
    sudo apt install chromium-browser
    ```

  2. Use X11 forwarding when SSH'ing:
    ```bash
    ssh -X -i ~/.ssh/vm_key user@vm-ip
    ```

  3. Browser will open on host display:

    • gh CLI will launch chromium in VM
    • X11 forwards it to your host display
    • Authenticate in browser on your host

Impact

  • Cleaner VM experience without plugin errors
  • No more starship warnings
  • gh CLI works out of the box with any installed browser
  • Uses chromium instead of firefox in VMs (as preferred)

Problem:
- init.vim tries to load gruvbox colorscheme that's not installed in VMs
- starship.toml has format string errors for git_status
- BROWSER hardcoded to firefox which isn't installed in VMs

Changes:
- init.vim: Disable gruvbox plugin for minimal VM setup
- starship.toml: Fix git_status format strings (add ${count} consistently)
- .zshenv: Auto-detect available browser (prioritize chromium-browser for VMs)

Impact:
- No more vim errors on VM startup
- No more starship warnings in git repos
- gh CLI can work with any installed browser (chromium recommended for VMs)
Add librewolf as first choice for BROWSER variable detection.
LibreWolf is privacy-focused and will be installed by default in VMs.

Priority order now:
1. librewolf (VMs)
2. firefox (host/fallback)
3. chromium-browser
4. chromium
5. xdg-open
@maxrantil maxrantil merged commit be769fd into master Nov 17, 2025
13 checks passed
@maxrantil maxrantil deleted the fix/vm-issues-gruvbox-starship-browser branch November 17, 2025 17:46
maxrantil added a commit that referenced this pull request Nov 18, 2025
Update SESSION_HANDOVER.md to document the starship username/hostname
always-show feature (PR #75) instead of the previous PR #74.

Includes feature implementation details, next session priorities,
and startup prompt for continuity.

Fixes the failing verify-session-handoff CI check.
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.

2 participants