From 533a8b94aeacc6db9dc718892903bf8b22e7519f Mon Sep 17 00:00:00 2001 From: nadrad Date: Sat, 30 Mar 2024 19:06:41 +0100 Subject: [PATCH] ctrl+q for debugging --- h-m-m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/h-m-m b/h-m-m index f639dc7..8970294 100755 --- a/h-m-m +++ b/h-m-m @@ -338,6 +338,7 @@ $keybindings[special_keys['ctrl_p']] = 'append'; $keybindings['q'] = 'quit'; $keybindings['Q'] = 'shutdown'; +$keybindings[special_keys['ctrl_q']] = 'quit_with_debug'; $keybindings['r'] = 'collapse_other_branches'; $keybindings['R'] = 'collapse_inner'; @@ -2558,6 +2559,22 @@ function quit() } +function quit_with_debug() +{ + global $mm; + $file = fopen('./h-m-m--debug.txt', "w"); + + if ($file!==false) + { + fwrite($file, serialize($mm)); + fclose($file); + echo "Debug information is written to h-m-m--debug.txt file."; + } + + shutdown(); +} + + // }}} // {{{ move_window