Skip to content

Instantly share code, notes, and snippets.

@andresrinivasan
Created December 28, 2022 06:12
Show Gist options
  • Select an option

  • Save andresrinivasan/d386ad4cbaffcc70620defc3c3ac65df to your computer and use it in GitHub Desktop.

Select an option

Save andresrinivasan/d386ad4cbaffcc70620defc3c3ac65df to your computer and use it in GitHub Desktop.
Create and sometimes raise iTerm window
#!/usr/bin/env python3
import sys
import iterm2
async def main(connection):
w = await iterm2.Window.async_create(connection)
await w.async_activate() # Not sufficient to always raise the window
if __name__ == "__main__":
iterm2.run_until_complete(main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment