Skip to content

Add short hostname prompt format string: \H#1680

Open
rolandwalker wants to merge 1 commit intomainfrom
RW/short-host-prompt-format-string
Open

Add short hostname prompt format string: \H#1680
rolandwalker wants to merge 1 commit intomainfrom
RW/short-host-prompt-format-string

Conversation

@rolandwalker
Copy link
Contributor

Description

The \h and \H feel backwards, but \h already existed, and reversing them would be changing the defaults.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this Mar 6, 2026
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

  1. Missing regression tests for new \H token
    \\H was added in prompt rendering, but there’s no test coverage in test/test_main.py for the new behavior (only existing \\h cases are covered). This leaves edge behavior unverified and easy to break in future refactors.

Action: add focused tests for:

  • FQDN host (db01.prod.example.com) -> \\H renders db01
  • no host (host=None) -> \\H renders localhost
  • optional: login_path_as_host=True path to confirm intended \\H behavior with login aliases

No correctness/security regressions were obvious from the diff beyond this test gap.

@rolandwalker rolandwalker force-pushed the RW/short-host-prompt-format-string branch from 730e6fc to 8e3d27b Compare March 6, 2026 10:39
The \h and \H feel backwards, but \h already existed, and reversing
them would be changing the defaults.
@rolandwalker rolandwalker force-pushed the RW/short-host-prompt-format-string branch from 8e3d27b to 127e6f7 Compare March 6, 2026 19:42
Copy link
Contributor

@scottnemes scottnemes left a comment

Choose a reason for hiding this comment

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

Verified short hostname value works to show the shortened hostname

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