Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/i2cssh/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ def app(hosts_or_cluster, *_args, **cmdline_opts):
# Preserve current $PATH variable. Some shells (e.g. fish) are not in the default $PATH.
current_path = os.environ.get("PATH")

# Python 3.12+ no longer implicitly creates an event loop; iterm2 requires one to exist.
try:
asyncio.get_event_loop()
except RuntimeError:
asyncio.set_event_loop(asyncio.new_event_loop())

# Execute the SSH sessions
iterm2.run_until_complete(
exec_in_iterm(groups, cmdline_opts, global_opts, current_path)
Expand Down