Created
September 8, 2019 05:00
-
-
Save gnachman/d7c35930c1191393838bf18a19b5bfe8 to your computer and use it in GitHub Desktop.
This file contains 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
import iterm2 | |
async def main(connection): | |
app = await iterm2.async_get_app(connection) | |
window = app.current_terminal_window | |
tab = window.tabs[0] | |
print(f'Before: {tab.sessions}') | |
await tab.sessions[0].async_split_pane() | |
print(f'After: {tab.sessions}') | |
iterm2.run_until_complete(main) | |
# Output is: | |
Before: [<Session name=vim id=4058DAA1-B6C6-4376-B822-7A6E5EDADBB0>] | |
After: [<Session name=vim id=4058DAA1-B6C6-4376-B822-7A6E5EDADBB0>, <Session name= id=A82F1674-C386-4CAA-868B-507C4474A1BB>] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a version that doesn't behave properly: