let run_with_quit_key action =
Deferred_list.pick_and_cancel [
action#start;
begin
let rec kbd_loop () =
Log.(s (quit_key_information ()) @ normal);
get_key ()
>>= function
| 'q' | 'Q' ->
action#stop;
return ()
| _ -> kbd_loop ()
in
kbd_loop ()
end;
]