Skip to content

feat(display): add include_cwd_prefix toggle (#1221)#1229

Open
Kevsosmooth wants to merge 1 commit into
asheshgoplani:mainfrom
Kevsosmooth:feat/display-include-cwd-prefix
Open

feat(display): add include_cwd_prefix toggle (#1221)#1229
Kevsosmooth wants to merge 1 commit into
asheshgoplani:mainfrom
Kevsosmooth:feat/display-include-cwd-prefix

Conversation

@Kevsosmooth
Copy link
Copy Markdown

@Kevsosmooth Kevsosmooth commented May 29, 2026

Implements #1221.

Adds a [display] include_cwd_prefix config knob (default true) that gates the [<cwd-basename>] prefix on the terminal title (set-titles-string). The default preserves the current [<project>] <name> format; set it to false to show only the session title.

Per the issue thread, the prefix is gated at the single place the title is formatted (buildTerminalTitleArgs), driven by config resolved once at startup.

Changes

  • DisplaySettings.IncludeCwdPrefix *bool + GetIncludeCwdPrefix() — defaults to true.
  • internal/tmux: package-level hideCwdPrefixInTitle flag gates the set-titles-string value; SetHideCwdPrefixInTitle(...) is called once at TUI startup from cfg.Display.GetIncludeCwdPrefix().
  • Tests: getter default, TOML decode of the new key, and the title builder emitting the prefix on/off.

Behavior

Default is true, so existing setups are unchanged. To opt out:

[display]
include_cwd_prefix = false

Summary by CodeRabbit

  • New Features
    • Added new configuration option include_cwd_prefix to control whether terminal and pane titles include the current working directory basename prefix. This setting defaults to true for backward compatibility and can be disabled to display cleaner terminal titles with only the display name.

Review Change Stack

Add a [display] include_cwd_prefix config knob (default true) that gates the
"[<cwd-basename>]" prefix on the tmux terminal title (set-titles-string).
The default preserves the historical "[<project>] <name>" format; set it to
false to show only the session title.

- DisplaySettings.IncludeCwdPrefix (*bool) + GetIncludeCwdPrefix(), default true
- tmux: package-level hideCwdPrefixInTitle flag gates set-titles-string at the
  single format site; set once at TUI startup from the resolved user config
- tests: getter default, TOML decode, and title-builder prefix on/off

Implements asheshgoplani#1221
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f34ffb1-3dee-4043-8240-1eb303edaf80

📥 Commits

Reviewing files that changed from the base of the PR and between f6bc0f5 and 419a55c.

📒 Files selected for processing (5)
  • internal/session/userconfig.go
  • internal/session/userconfig_test.go
  • internal/tmux/tmux.go
  • internal/tmux/tmux_test.go
  • internal/ui/home.go

📝 Walkthrough

Walkthrough

This PR adds an optional TOML configuration setting include_cwd_prefix to DisplaySettings that controls whether tmux terminal titles include a [<project>] prefix. A getter defaults the setting to true when unset. An atomic flag in tmux receives this setting during UI initialization and buildTerminalTitleArgs() conditionally omits the project prefix from the title string based on the flag state.

Changes

CWD prefix title configuration

Layer / File(s) Summary
Display settings schema and getter
internal/session/userconfig.go, internal/session/userconfig_test.go
DisplaySettings adds an optional IncludeCwdPrefix TOML field with TOML key include_cwd_prefix. GetIncludeCwdPrefix() returns true when the field is unset (nil), otherwise the configured value. Tests verify the getter default and explicit true/false behavior, as well as TOML decoding.
Tmux title formatting with configurable CWD prefix
internal/tmux/tmux.go, internal/tmux/tmux_test.go
A package-level atomic boolean hideCwdPrefixInTitle with setter SetHideCwdPrefixInTitle(bool) enables concurrent configuration. buildTerminalTitleArgs() conditionally omits the @agentdeck_project_name prefix from set-titles-string when the flag is enabled, using only @agentdeck_display_name. Test coverage validates the title output toggles between "[#{@agentdeck_project_name}] #{@agentdeck_display_name}" (default) and "#{@agentdeck_display_name}" (prefix hidden).
Configuration wiring in UI initialization
internal/ui/home.go
During NewHomeWithProfileAndMode setup, the display config is applied to tmux by calling SetHideCwdPrefixInTitle(!cfg.Display.GetIncludeCwdPrefix()), binding the user setting to the title formatting behavior.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 70.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title follows the Conventional Commits format with the 'feat' type and '(display)' scope, and accurately describes the main change: adding a toggle for the include_cwd_prefix configuration option.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Remote_parity ✅ Passed Remote sessions don't create local tmux sessions; PR's tmux title feature applies only to local sessions via TestBuildTerminalTitleArgs_CwdPrefixHidden test.
Test_coverage_per_surface ✅ Passed Feature is TUI-only (controls tmux terminal title), not applicable to Web/CLI/Remote surfaces. TUI tests for the getter and title builder are provided.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

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