Show hostname in Starship over SSH#6049
Open
crmne wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds Starship prompt support for showing the hostname when connected via SSH, and provides a migration script to update existing local configs safely.
Changes:
- Update Starship prompt
formatto include$hostname. - Add
[hostname]module configuration withssh_only = true. - Add a migration script to patch existing
~/.config/starship.tomlif it matches the previous format.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| migrations/1780739892.sh | Introduces a migration to rewrite the Starship format line and append a [hostname] config block. |
| config/starship.toml | Updates the default Starship config to include hostname in the prompt when on SSH. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
33c5dbe to
59681e1
Compare
Member
|
Need a screenshot here too, but I don't think I'm likely to be onboard, because it would duplicate the hostname we already have in the upper right with tmux. |
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.
Summary
Add Starship's
hostnamemodule to the prompt withssh_only = true.Local prompts remain unchanged, but SSH sessions show the hostname before the directory/git segments.
Why
When working across remote shells, the current prompt makes it too easy to lose track of which machine a terminal is connected to. Starship already supports this exact use case with
ssh_only, so this keeps the normal local prompt clean while making remote sessions clearer.Testing
STARSHIP_CONFIG=$PWD/config/starship.toml starship explainbash -n migrations/1780739892.shgit diff --check origin/dev..cp/starship-ssh-hostname-clean