Skip to content

Show hostname in Starship over SSH#6049

Open
crmne wants to merge 1 commit into
basecamp:devfrom
crmne:cp/starship-ssh-hostname-clean
Open

Show hostname in Starship over SSH#6049
crmne wants to merge 1 commit into
basecamp:devfrom
crmne:cp/starship-ssh-hostname-clean

Conversation

@crmne

@crmne crmne commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Add Starship's hostname module to the prompt with ssh_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 explain
  • bash -n migrations/1780739892.sh
  • smoke-tested the migration against the previous default Starship format
  • git diff --check origin/dev..cp/starship-ssh-hostname-clean

Copilot AI review requested due to automatic review settings June 6, 2026 10:20

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

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 format to include $hostname.
  • Add [hostname] module configuration with ssh_only = true.
  • Add a migration script to patch existing ~/.config/starship.toml if 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.

Comment thread migrations/1780739892.sh
Comment thread migrations/1780739892.sh Outdated
Comment thread migrations/1780739892.sh Outdated
@crmne crmne force-pushed the cp/starship-ssh-hostname-clean branch from 33c5dbe to 59681e1 Compare June 6, 2026 10:25
@dhh

dhh commented Jun 8, 2026

Copy link
Copy Markdown
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.

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