feat: Always display username@hostname in starship prompt #75
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.
Summary
Configure starship to always display username and hostname (not just during SSH sessions) for better VM identification clarity.
Context
This change complements the vm-infra configurable username feature (maxrantil/vm-infra#117, PR maxrantil/vm-infra#118) where VMs are provisioned with:
developer,testuser)work-vm-1,test-vm-2)Problem: Default starship config only shows username during SSH sessions. When working with multiple VMs, it's hard to identify which VM you're in.
Solution: Always show
username@hostnamein the prompt for immediate context.Changes
starship.toml
[username]section withshow_always = true[hostname]section withssh_only = false@prefix.local)$username$hostnameResult
Before:
After:
Benefits
Multi-VM Clarity:
developer@work-vm-1vsdeveloper@work-vm-2- instantly clear which VMtestuser@test-vmvsdeveloper@prod-vm- context at a glanceSecurity:
Testing
Tested with vm-infra's
--test-dotfilesflag:Expected prompt:
testuser@test-vm ~/pathReferences
STARSHIP_CONFIG_NOTE.mdin vm-infra repoReady for review - Simple config change, well-documented, tested with vm-infra integration.