Skip to content

Show PostgreSQL service names in the prompt - #1632

Open
jackwalkerlabs wants to merge 1 commit into
dbcli:mainfrom
jackwalkerlabs:feat/service-prompt-1624
Open

Show PostgreSQL service names in the prompt#1632
jackwalkerlabs wants to merge 1 commit into
dbcli:mainfrom
jackwalkerlabs:feat/service-prompt-1624

Conversation

@jackwalkerlabs

Copy link
Copy Markdown

Add a \service prompt token for connections made with service=... or PGSERVICE. Users can set prompt = '\service> ' to show their familiar service name instead of a long hostname. Direct connections clear the token after a successful connection.

Fixes #1624.

Validation: full suite against an isolated PostgreSQL 17 instance: 2,782 passed, 1 xfailed, 1 xpassed. Tests cover explicit/environment service names, an empty token without a service, and clearing it on direct reconnect. Ruff hooks pass. Python 3.12 on macOS.

Implemented and tested using Codex under the submitting account's authorization.

Checklist

  • Added changelog entry and prompt configuration documentation.
  • Added submitting account to AUTHORS.
  • Installed pre-commit hooks.
  • Verified behavior and ran tests.
  • Please squash merge.

Fixes dbcli#1624. Implemented and validated with Codex.
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.

Feature Request: show service name in prompt

1 participant