Created
December 28, 2022 06:12
-
-
Save andresrinivasan/db6b6cd09f15ce249305ce5a1fd1b698 to your computer and use it in GitHub Desktop.
Create and raise iTerm window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 | |
| a = await iterm2.async_get_app(connection) | |
| await a.async_activate(False, True) # Raise only current active 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