Skip to content

fix: only open browser in interactive (TTY) sessions - #12

Merged
mlnchk merged 1 commit into
mainfrom
fix/no-browser-open-noninteractive
Aug 18, 2026
Merged

fix: only open browser in interactive (TTY) sessions#12
mlnchk merged 1 commit into
mainfrom
fix/no-browser-open-noninteractive

Conversation

@mlnchk

@mlnchk mlnchk commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Problem

Running the unit tests opened a browser to https://auth.adapty.io/activate?code=... on every run — the auth login and asa connect commands called open() unconditionally, so any non-interactive execution (tests, piped runs, CI) launched a browser.

Change

Guard both open() calls on process.stdin.isTTY === true, matching the existing interactivity check in asa-confirm.ts. In interactive terminals behavior is unchanged; in tests/pipes the browser is skipped. The verification URL is still printed in all cases, so users can open it manually.

  • src/commands/auth/login.ts
  • src/commands/asa/connect.ts

Verification

auth login test passes and no longer opens a browser.

auth login and asa connect called open() unconditionally, launching a
browser during tests and piped/non-interactive runs. Guard both on
process.stdin.isTTY; the verification URL is still printed.
@mlnchk
mlnchk merged commit e0b8d77 into main Aug 18, 2026
4 checks passed
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