Switch servers in the window, and reconnect when the connection drops

The UI now owns the server it shows, as one thing: the connection, the workspace on it, and what reaches it again. It follows the server's events itself, and can put another server in its place. - UI.Connect switches to another server, by what -server takes. It connects in the background, and the window keeps showing the current server until the new one is ready; a server that can't be reached leaves the window where it was, with the reason kept for the chip. - When the connection drops, the UI reaches the same server again, waiting 0, 1, 2, 5, then every 10 seconds, and shows the session it showed before, or the one the server picks if that has gone. Its terminals restore from fresh snapshots. - Work that outlives a frame (fetching the keymap or the server's details, answering another client) carries the connection it began on, so a switch can't cross them over; a keymap from a server switched away from is dropped. - internal/hosts holds what main did to reach a server, and lists and saves hosts on the local server, for the host picker. Tests switch between two servers and to one that isn't there, and drop a connection (rex.Conn.Drop, as a network failure would) to see the window reconnect to the same session.


Author Daniel Patterson Date Commit Parent eccec265 Change ID