terminal events trigger in sockets.py