Skip to content

Instantly share code, notes, and snippets.

@atwright147
Created August 27, 2019 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atwright147/a35605c64fa24bc9768d10c5e70724d1 to your computer and use it in GitHub Desktop.
Save atwright147/a35605c64fa24bc9768d10c5e70724d1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3.7
import iterm2
# This script was created with the "basic" environment which does not support adding dependencies
# with pip.
async def main(connection):
# Your code goes here. Here's a bit of example code that adds a tab to the current window:
app = await iterm2.async_get_app(connection)
window = app.current_terminal_window
if window is not None:
await window.async_create_tab()
else:
# You can view this message in the script console.
print("No current window")
session = window.current_tab.current_session
await session.async_split_pane(True)
await session.async_split_pane()
await session.async_split_pane()
update = iterm2.LocalWriteOnlyProfile()
update.set_allow_title_setting(False)
update.set_name("Window Name")
await session.async_set_profile_properties(update)
iterm2.run_until_complete(main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment