Skip to content

Fix iterm API calls#32

Open
urjitbhatia wants to merge 2 commits intomkusaka:mainfrom
urjitbhatia:main
Open

Fix iterm API calls#32
urjitbhatia wants to merge 2 commits intomkusaka:mainfrom
urjitbhatia:main

Conversation

@urjitbhatia
Copy link

Hi

A bunch of the iTerm API calls were falling. They're pretty much fixed here. And commands like new session, send message etc are fully working.

urjitbhatia and others added 2 commits February 6, 2026 00:17
App.async_create_window() does not exist in iterm2 v2.13. The correct
API is iterm2.Window.async_create(connection, profile, command), which
is a static method on the Window class.

This also passes the --command flag directly to the iterm2 API instead
of manually sending text via async_send_text after window creation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Click derives kwarg names from option strings: --session -> `session`,
--all -> `all`, --window -> `window`. But shortcut functions declared
mismatched parameter names (session_id, all_sessions, window_id),
causing TypeErrors on invocation.

Fixed by either renaming function params to match the Click-derived
names, or adding explicit Click name arguments (e.g. "--all", "-a",
"all_sessions") where the Python kwarg must differ from the option.

Affected shortcuts: send, run, split, vsplit, clear, newtab.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mkusaka
Copy link
Owner

mkusaka commented Feb 8, 2026

@urjitbhatia
Thanks for the PR! The issues you identified (using Window.async_create() instead of app.async_create_window(), and fixing the Click option/parameter name mismatches) are spot on.

However, these have already been fixed independently on the main branch (commits 36823cd and eb7ad24). Could you verify that and close this PR if so? Thanks again for taking the time to look into this!

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.

2 participants