diff --git a/src/plugins/server/main.ml b/src/plugins/server/main.ml index fe34558ded99f45ed03fd9d7a1fd4db5fa278d41..976f0d47d54a626ce8c665acb67565376803b04a 100644 --- a/src/plugins/server/main.ml +++ b/src/plugins/server/main.ml @@ -341,6 +341,7 @@ let create ~pretty ?(equal=(=)) ~fetch () = (* -------------------------------------------------------------------------- *) let start server = + emitter := do_signal server ; match server.daemon with | Some _ -> () | None -> @@ -357,6 +358,7 @@ let start server = end let stop server = + emitter := nop ; match server.daemon with | None -> () | Some daemon -> @@ -368,6 +370,7 @@ let stop server = end let foreground server = + emitter := do_signal server ; match server.daemon with | None -> () | Some daemon -> @@ -386,7 +389,6 @@ let run server = Sys.catch_break true ) ; foreground server ; - emitter := do_signal server ; set_active true ; Senv.feedback "Server running." ; begin diff --git a/src/plugins/server/states.ml b/src/plugins/server/states.ml index 9d3d39768162e50d08b6c0a408277000f7a09e13..8b28add10a63c80483aed19e9434ab0fe29660c2 100644 --- a/src/plugins/server/states.ml +++ b/src/plugins/server/states.ml @@ -27,7 +27,7 @@ type 'a callback = ('a -> unit) -> unit let install signal hook = function | None -> () | Some add_hook -> - let once = ref false in + let once = ref true in let install ok = if ok && !once then begin