Skip to content

extraLabel from --extra-cmd not displayed in expanded layout #242

@mousedown

Description

@mousedown

Description

The --extra-cmd feature allows users to add custom labels to the HUD (e.g. auth status, custom metrics). However, the extraLabel is only rendered in compact mode via renderSessionLine() in session-line.ts:204-205.

In the default expanded layout, renderExpanded() iterates over elementOrder and calls renderElementLine() for each element — but extraLabel is never referenced in this path, so it silently disappears.

Expected behaviour

extraLabel should be displayed in both compact and expanded layouts.

Suggested fix

Append extraLabel to the project line in src/render/lines/project.ts, after the session name and before the empty-check:

if (ctx.extraLabel) {
  parts.push(dim(ctx.extraLabel));
}

This keeps it consistent with compact mode (where it appears on the session/project line) and doesn't require adding a new HudElement type.

Reproduction

  1. Configure --extra-cmd with any command that returns {"label": "test"}
  2. Use the default expanded layout
  3. The label is not displayed

Switch to "lineLayout": "compact" and the label appears.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions