const char *default_tty,
bool should_add_displays);
static void toggle_between_splash_and_details (state_t *state);
+static void tell_systemd_to_print_details (state_t *state);
+static void tell_systemd_to_stop_printing_details (state_t *state);
static void
on_session_output (state_t *state,
state->quit_trigger = quit_trigger;
state->should_retain_splash = retain_splash;
+#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION
+ tell_systemd_to_stop_printing_details (state);
+#endif
+
ply_trace ("time to quit, closing log");
if (state->session != NULL)
ply_terminal_session_close_log (state->session);
return NULL;
}
+#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION
+ if (state->is_attached)
+ tell_systemd_to_print_details (state);
+#endif
+
if (state->keyboard != NULL)
ply_keyboard_watch_for_input (state->keyboard);
state->is_attached = true;
state->session = session;
-#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION
- tell_systemd_to_print_details (state);
-#endif
-
return true;
}
if (!state->is_attached)
return;
-#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION
- tell_systemd_to_stop_printing_details (state);
-#endif
-
ply_trace ("detaching from terminal session");
ply_terminal_session_detach (state->session);
state->is_redirected = false;