This file contains hidden or 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 signal | |
| import sys | |
| import time | |
| import pty | |
| from functools import partial | |
| def signal_handler(tag, signum, frame): | |
| print(f"\n{tag} Received SIGINT, exiting...") | |
| exit(0) |
This file contains hidden or 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 signal | |
| import sys | |
| import pty | |
| def main(is_child): | |
| # Set up signal handler | |
| def sigint_handler(signum, frame): | |
| role = "CHILD" if is_child else "PARENT" | |
| print(f"\n[{role}] Caught SIGINT, exiting...") | |
| sys.exit(0) |
OlderNewer