mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-22 16:02:24 +00:00
`tty7 split` spawns the shell and only then asks the tree to hold it, so any refusal in between leaves a pane running that nothing references — `pane ls --all` shows it, the tree does not, and `pane close --orphans` is the only way to be rid of it. Two attempts at `--ratio nan` left two. NaN is the case that gets there, because it cannot be serialised onto the control connection at all. The link drops mid-request, so the daemon's own "a split ratio must be a finite number" never comes back: the caller sees "control connection lost (request 2)" instead, which says nothing about the ratio, and the pane is already running. Refuse a non-finite ratio before the spawn, in the daemon's own terms. Its clamp to a usable range is deliberate and stays its business — 0, 1 and 5.0 still land on the clamp, as intended; this only refuses what the daemon would refuse anyway. Then take the pane back down if the split fails for any other reason too. Nobody asked for a pane that no tree holds, and leaving it for the user to find with `--orphans` is not a refusal, it is a mess. Verified against a live server: two refused splits now leave the pane count where it was, and a valid `--ratio 0.3` split still works. Swept the rest of the value-taking flags while here, all sound: `-m` on an unknown machine, `--key` on an unknown key (which lists the real ones), `--timeout 0` (exits 124, the conventional code) and a negative timeout are each refused with the right message.