Source code for iterm2.sharedstate
import _socket as socket
_socket = None
_notification_handlers = []
def _notification_handler(notification):
for handler in _notification_handlers:
handler(notification)
[docs]def get_socket():
global _socket
if _socket is None:
_socket = socket.Connection()
_socket.connect(_notification_handler)
return _socket