Persistent Sessions

Wintty sessions run in the winttyd daemon: close the app or take an update and they keep running. Reattach with layout and scrollback. The winttyc CLI, documented.

Wintty Pro keeps sessions running in a per-user daemon. Closing the app, or installing an app update, does not end the programs a session is running. Open Wintty again and the same sessions are there, with their programs, pane layout, and scrollback.

What persists and what does not

A session carries three things: the programs running in it, its pane layout, and its scrollback. None of them are tied to a window. Close the last Wintty window and the daemon keeps the session going; reopen, and it comes back the way you left it.

App updates behave the same way. An update that does not change the daemon leaves the daemon running, so sessions and their programs continue straight through it.

A Windows reboot ends sessions. The daemon starts when you log on, and it starts with nothing running: the machine was off, and the programs went with it.

The session daemon

Sessions run in winttyd, a background daemon that Wintty starts for your user account. The first app start registers a Scheduled Task, the task starts the daemon at logon, and none of that needs administrator rights, because the task runs as you.

The task is set up the way a daemon needs: the default 72-hour execution limit is off, it starts on battery and keeps running when you unplug, and if the daemon exits unexpectedly the task restarts it three times, a minute apart. A machine that was asleep through its logon window starts the daemon when it wakes.

Note

The daemon holds the sessions, so it outlives every Wintty window. Its logon task belongs to your user account, and each installed edition registers its own.

Persistent by default

New tabs and splits are persistent: once created they live in the daemon, and they come back when you reopen Wintty.

Two things still open a plain tab: Ctrl+Alt+T, and an Alt+click. A plain tab ends when you close it and nothing restores it. A setting brings back the old default, where nothing is persistent unless you ask.

The sessions picker

The picker lists every session the daemon holds. Three things can happen next:

  • Focus a session that is already attached to a window on screen.
  • Open a session no window has attached.
  • Take over a session another window has attached. Wintty asks for a confirm before the session moves.

The pane layout belongs to the session rather than to the window, so it moves with it: splits, their order, and their sizes come back exactly as they were.

The winttyc command-line tool

The daemon has a command-line tool, winttyc, and its verbs cover the picker's actions plus a few only a script would want:

VerbWhat it does
listShow the sessions the daemon holds
newStart a new persistent session
killEnd one or more sessions
sendSend bytes to a session's input
printWrite bytes to a session's display without them passing through the shell
renameRename a session
historyPrint a session's scrollback: --text by default, --vt, or --html
tailStream a session's output as it arrives. Ctrl+C detaches and leaves the session running
autostartInstall, inspect, or remove the daemon's logon task

Every verb is a plain subcommand, so PowerShell scripts and profiles can call the tool like any other command-line program:

Set-Alias ws winttyc
ws list

Secrets

A session you reattach can carry state with it: environment variables and tokens. Wintty encrypts those on disk for your user account with the Windows Data Protection API. They are not stored as plain text.

Availability

Persistent sessions are part of Wintty Pro. What each tier includes puts that in context next to everything else each tier carries.

Note

Prebuilt builds are for sponsors. The source is free and always will be, and you can build it yourself. No build has been published yet either, so there is nothing to download today.