Skip to content

feat(ui): optionally set the terminal title to the active context and view - #4374

Open
DerSimeon wants to merge 1 commit into
derailed:masterfrom
DerSimeon:feat/terminal-title
Open

DerSimeon wants to merge 1 commit into
derailed:masterfrom
DerSimeon:feat/terminal-title

Conversation

@DerSimeon

Copy link
Copy Markdown

Adds an opt-in ui.terminalTitle setting (default false). When enabled, k9s sets the terminal title to k9s | <context> | <view>, keeps it in sync on navigation and :ctx switches, and restores the previous title on exit.

k9s:
  ui:
    terminalTitle: true

This makes it easy to tell which tab talks to which cluster.

  • Linux, macOS, FreeBSD: writes OSC 0 to /dev/tty and saves/restores the old title with the xterm title stack.
  • Windows: uses GetConsoleTitleW / SetConsoleTitleW (conhost and Windows Terminal).
  • Control characters are stripped from the title.
  • Config schema, README and test fixtures are updated.

Tested with unit tests, builds for all four OSes, and golangci-lint with 0 issues on each.

PR made with AI Assistance. (Review, Linting, Fact checking, Testing, Commenting)

This branch has not been deployed

No deployments
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.

1 participant