Then build a manager that keeps long-running services in a detached tmux session. libtmux drives a real tmux server from code. It gives you objects for the server, its sessions, windows and panes. Documentation for every language is at https://libtmux.org/en/. Language: PowerShell Package: LibTmux (PowerShell Gallery) Repository: https://github.com/libtmux/libtmux-powershell Read these before writing code: - https://libtmux.org/en/powershell/latest/llms.txt every page for PowerShell, as a list - https://libtmux.org/en/powershell/latest/docs.json the same list with headings, as JSON - https://libtmux.org/en/powershell/latest/reference/ the PowerShell API reference If you cannot fetch URLs, clone the repository above and read its README and examples instead, or ask me to paste those pages in. Set up first: 1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so nothing below works without one. Stop and tell me if it is missing. 2. If this directory is not a PowerShell project yet, Create a PowerShell script in this directory; no project manifest is required. Skip this in a project that already exists, and match what is here. 3. Add the dependency. LibTmux has no stable release. 0.1.0-alpha2 is the newest prerelease on PowerShell Gallery, and the command below names it because the resolver skips prereleases otherwise. Install-Module -Name LibTmux -RequiredVersion 0.1.0-alpha2 -AllowPrerelease Check https://www.powershellgallery.com/packages/LibTmux for a newer version, and prefer a stable release over this one if there now is any. Import LibTmux after installation. LibTmux.Workspace is a separate module; the .NET MCP tool does not import either module. 4. Write the smallest program that proves the install works: connect to a tmux server, create a session, confirm it is there, then kill it. Give that server a socket of its own rather than using the default one, so this never touches a tmux I am already running. Run it, and show me the output and the files you added. Rules for everything below: - Use the reference above rather than guessing names. The ten libtmux ports do not share spellings, and a name from another language will look plausible and not exist. - If the reference does not have something you expected, say so instead of writing a call that does not exist. - Follow the conventions already in this repository. Detached service manager What it does: - Reads a small config listing services to run, each with a name, a working directory and a command. Start with a Jupyter notebook server as the worked example. - Starts them in one detached session at login, one window per service, so nothing depends on a terminal staying open. - Is idempotent. Running it twice does not start a second copy of anything; it reports what was already up and starts only what was missing. - Restarts a service that has died, and tells me which one and when. - Gives me a command to attach and look at any service's output. Constraints: - Decide whether a service is running by asking the tmux server what exists, not by writing a PID file that outlives the process. - A service that fails to start must be reported, not silently skipped. - Say in a comment how this gets invoked at login on this platform, and why detached is the right mode. Anchor it in these pages: - https://libtmux.org/en/tmux/concepts/workspaces/ workspaces - https://libtmux.org/en/tmux/concepts/server-session-window-pane/ server session window pane - https://libtmux.org/en/tmux/examples/workspace-from-file/ workspace from file