Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Trigger An External Process When A New Tab Is Made In iTerm2

This is what I use for iterm - image - cycler.

It's a bare bones script for iTerm2 two that triggers and external process.

python
#!/usr/bin/env python3

import iterm2
import subprocess

async def main(connection):
    async with iterm2.NewSessionMonitor(connection) as mon:
        while True:
            await mon.async_get()
            subprocess.run(['path/to/executable'])
iterm2.run_forever(main)