From 836069c1323a85f41e4294a6c79e92a924f542b3 Mon Sep 17 00:00:00 2001 From: cttech-io Date: Thu, 27 Aug 2026 16:29:05 +0100 Subject: [PATCH] docs: clarify prep-cmd lifecycle vs client connect/disconnect Prep-commands run on application start and termination, which is not the same as a client connecting and disconnecting. A disconnect keeps the session alive so the client can resume, so undo does not run then, and a reconnect resumes that session rather than relaunching, so do does not run either. The undo half is known (#3481). The reconnect half does not appear to be documented, and is the more confusing of the two: the stream returns without the state the do command was meant to establish. --- docs/configuration.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index d55dc380f82..30e7d58d906 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -223,6 +223,14 @@ editing the `conf` file in a text editor. Use the examples as reference. A list of commands to be run before/after all applications. If any of the prep-commands fail, starting the application is aborted. + @note{These run when the application starts and terminates, which is not + the same as a client connecting and disconnecting. Disconnecting does not terminate the + application - the session is kept alive so the client can resume - so undo + runs only on actual termination (quitting from the client, stopping it in the Web UI, or + Sunshine shutting down). Reconnecting resumes that session rather than launching the + application again, so do does not run on a reconnect either. Prep-commands + that change machine state needed by every stream, such as display layout or audio + routing, will therefore not be reapplied when a client resumes an existing session.}