close
Skip to content

Use sink for already logged in output#212

Open
gtsiolis wants to merge 1 commit intomainfrom
des-209-hide-banner-on-login-command
Open

Use sink for already logged in output#212
gtsiolis wants to merge 1 commit intomainfrom
des-209-hide-banner-on-login-command

Conversation

@gtsiolis
Copy link
Copy Markdown
Member

@gtsiolis gtsiolis commented Apr 28, 2026

This will fix two issues with the login command:

  1. Hide header/banner when already logged in - The login command now checks for existing auth (env var or stored token) before launching the TUI. If already logged in, it emits a colored note and exits without showing the header.
  2. Note messages now have colors in plain output mode - Added styling to formatMessageEvent() so notes, warnings, and success messages render with colors in non-TTY mode (matching the TUI styling).
BEFORE AFTER
Screenshot 2026-04-28 at 16 47 58 Screenshot 2026-04-28 at 16 44 14

@gtsiolis
Copy link
Copy Markdown
Member Author

Cc @carole-lavillonniere in case this relates to #208 (comment).

@gtsiolis gtsiolis force-pushed the des-209-hide-banner-on-login-command branch 2 times, most recently from 1749645 to c8b617c Compare May 5, 2026 13:26
@gtsiolis gtsiolis force-pushed the des-209-hide-banner-on-login-command branch from c8b617c to 27c207b Compare May 5, 2026 13:35
return styles.Secondary.Render(">") + " " + styles.Warning.Render("Warning:") + " " + e.Text
case SeveritySecondary:
return e.Text
return styles.SecondaryMessage.Render(e.Text)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

issue: the convention so far is to not do any styling in non-TTY.
What about keeping the TUI in this case but just hide the header, as we do in a few places already:

return runWithTUI(parentCtx, withoutHeader(), func(ctx context.Context, sink output.Sink) error {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants