Skip to content

auth check: use CheckAutomationEnabled instead of HasAuthentication - #1

Open
Fraser-Isbester wants to merge 2 commits into
tmc:mainfrom
Fraser-Isbester:fix/auth-check-use-automation-enabled
Open

auth check: use CheckAutomationEnabled instead of HasAuthentication#1
Fraser-Isbester wants to merge 2 commits into
tmc:mainfrom
Fraser-Isbester:fix/auth-check-use-automation-enabled

Conversation

@Fraser-Isbester

Copy link
Copy Markdown

Summary

  • auth check was reporting "Authentication is not configured" even when commands like session list worked fine
  • The root cause: auth check only tested for ITERM2_COOKIE in the environment (transient, not set in a fresh shell), while commands succeed as long as the iTerm2 API is enabled — auth is requested dynamically via AppleScript at connection time
  • Fix aligns auth check with the same CheckAutomationEnabled() logic used by client.Connect()
  • Also removes a redundant min helper now covered by the Go built-in

Test plan

  • it2 auth check returns "Authentication is configured" when iTerm2 API is enabled (even without ITERM2_COOKIE set)
  • it2 auth check returns "Authentication is not configured" and exits non-zero when API is disabled
  • it2 session list and other commands continue to work as before

🤖 Generated with Claude Code

Fraser-Isbester and others added 2 commits March 8, 2026 09:58
auth check was reporting "not configured" even when commands worked fine,
because it only checked for ITERM2_COOKIE in the environment. Commands
succeed as long as the API is enabled (auth is requested dynamically at
connect time), so align auth check with the same logic.

Also removes redundant min helper now covered by built-in.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements FindSimilarCommands and FormatSuggestions used for
"did you mean?" hints on unknown commands.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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