0.4.1
Added signal.DisableInterrupt
. This macro allows disabling SIGINT (Ctrl+C) for group of commands.
from xontrib.macro.signal import DisableInterrupt
echo start
with! DisableInterrupt:
echo 'sleep start'
sleep 10
echo 'sleep end'
echo finish
# start
# sleep start
# [Press Ctrl+C]
# KeyboardInterrupt will be raised at the end of current transaction.
# sleep end
# Exception KeyboardInterrupt: KeyboardInterrupt was received during transaction.