You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
close-app: target one of several instances of an app
#743
agent-desktop 1.3.1, macOS 27.2.1 (26B131), Apple Silicon.
close-app <APP> resolves the name to exactly one process instance
(select_unique_app in crates/core/src/system/app_lookup.rs). When two
instances share the name, it fails with AMBIGUOUS_TARGET and lists candidate_pids. This is safe, but an agent then cannot close only the instance
that it started.
Use case: launch "Visual Studio Code" --cdp --arg=--user-data-dir=<dir> starts
a test instance next to the user's own VS Code. Both are named Code. launch
returns data.pid and data.process_instance for the new instance, and list-windows gives its window ids. close-app accepts only <APP> and --force.
Proposal: add close-app --window-id <id>, resolved like press --window-id
from #237: take the instance that owns the window, matched by pid and
process-instance token. A --process-instance <token> option with the token
from launch would also work.
Docs: commands-system says that "close-app closes the app and all its
windows", and close-app --help describes --force as "Terminate matching app
processes". A reader can take both as "every instance". A note that close-app
acts on exactly one instance and refuses an ambiguous name would help.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
agent-desktop 1.3.1, macOS 27.2.1 (26B131), Apple Silicon.
close-app <APP>resolves the name to exactly one process instance(
select_unique_appincrates/core/src/system/app_lookup.rs). When twoinstances share the name, it fails with
AMBIGUOUS_TARGETand listscandidate_pids. This is safe, but an agent then cannot close only the instancethat it started.
Use case:
launch "Visual Studio Code" --cdp --arg=--user-data-dir=<dir>startsa test instance next to the user's own VS Code. Both are named
Code.launchreturns
data.pidanddata.process_instancefor the new instance, andlist-windowsgives its window ids.close-appaccepts only<APP>and--force.Proposal: add
close-app --window-id <id>, resolved likepress --window-idfrom #237: take the instance that owns the window, matched by pid and
process-instance token. A
--process-instance <token>option with the tokenfrom
launchwould also work.Docs:
commands-systemsays that "close-appcloses the app and all itswindows", and
close-app --helpdescribes--forceas "Terminate matching appprocesses". A reader can take both as "every instance". A note that
close-appacts on exactly one instance and refuses an ambiguous name would help.
All reactions