Repository navigation
Conversation
tui-kit v0.4.4 starts every runner child in its own session with no controlling terminal, so a program that asks a question now fails fast instead of hanging behind the TUI. Two upgrade paths could ask: - apt: the upgrade now carries the kit's APTEnv (DEBIAN_FRONTEND= noninteractive NEEDRESTART_MODE=a) and -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold, so debconf takes its defaults, needrestart restarts services instead of asking, and a locally changed config file keeps the local version (the package's is left as .dpkg-dist). The preview shows `sudo -n env ...` and the confirm dialog says what each part does. - Omarchy Server: omarchy-server-update is interactive by design, so its step is no longer a runner step. The plan marks it as a hand-off; after the same preview and confirm, Backend.HandOff prepares the process and tea.Exec gives it the terminal, restores the screen when it exits, and the sequence goes on and re-reads the machine. It is previewed and run with the prefix minus -n, since sudo may ask on the terminal it has. --demo-machine ubuntu|omarchy drives the two new paths without such a machine; two README screenshots show their confirm dialogs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MbCfX3T8khyd9hsrN5kMo3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #21
Release notes (0.3.0)
tui-kit v0.4.4 runs every command in a session with no terminal, so a program that asks a question fails at once instead of hanging behind the screen. The two upgrades that could ask are now handled.
sudo -n env DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold upgrade(ordist-upgrade). debconf takes its defaults, needrestart restarts the services left on replaced libraries, and a config file changed on the machine keeps the local version (the package's version is left beside it as.dpkg-dist). The confirm dialog shows the full command line and explains all three parts.omarchy-server-update run --no-rebootis interactive by design, so it no longer runs as a background step. After the same preview and confirm, tui-update hands the terminal over to it (tea.Exec). When it exits, the screen comes back, the sequence continues and the machine is read again. It is previewed and run withsudorather thansudo -n, because it has a terminal where sudo can ask for a password.--demo-machine ubuntu|omarchyruns both paths on a sample machine (the default isfedora). On the Omarchy sample machine, the hand-off shows on the real terminal what would run there and waits for Enter.confirm-apt,confirm-omarchy), and the install snippet now points at 0.3.0.How
pkgmgr.BuildUpgrade(apt) now hasEnv: kitpkg.APTEnv()and the dpkg options, set before the verb. Its description states the config-file policy.pkgmgr.IsHandOffmarks the Omarchy updater.assemblePlanrecords it in the newPlan.HandOff(index intoCommands) and adds the explanation sentences to the newPlan.Explain, which the confirm body shows.Backend.HandOff(cmd) (updates.Process, error). The real backend builds the process ininternal/pkgmgr/handoff.go(still the only exec site;check-execis clean) from the same resolved binary and escalation prefix minus-n.Real.Previewrenders a hand-off the same way, so the preview still matches what runs. The fake prints a line, waits for Enter and applies the upgrade to the sample machine.runStepsends a hand-off step totea.Execand runner steps to the background, as before. Both report back as astepMsg, so failure handling, the post snapshot and the final reload are unchanged.Tests
internal/pkgmgr/handoff_test.go: exact apt argv and env for both verbs, the escalated preview (sudo -n env ...), the Omarchy plan's single hand-off at the right index with the snapshot on and off, the hand-off argv and preview (prefix without-n,envfor variables, direct when running as root), refusal to hand off a runner step, the fake hand-off running and applying, and all sample machines.cmd/tui-update/handoff_test.go: the apt confirm dialog (command line and explanation), a full Omarchy sequence where the updater step is atea.Exec(not a runner step, and nothing runs before the hand-off) followed by the post snapshot and a reload, a failed hand-off stopping the sequence, and the--demo-machineflag.command_test.gopins the new apt command lines.make check(gofmt, vet, exec boundary, golangci-lint 0 issues, tests) andmake manifestpass.Lab evidence (lab host, 0.3.0-rc build, guests snapshotted first and restored after)
Ubuntu 24.04: an upgrade that would have prompted
Setup: needrestart 3.6-7ubuntu4.5 installed.
chronypinned back to4.5-1ubuntu4(noble-updates has4.5-1ubuntu4.2, which ships a different/etc/apparmor.d/usr.sbin.chronyd), and that conffile edited locally, so dpkg has a config-file question to ask. The upgrade was run from the TUI in tmux (p,U,y).Confirm dialog:
End of the apply pane (the refresh brought in 43 upgrades; the run took 32 s, from 01:22:10 to 01:22:42, and nothing hung):
dpkg's own record (
/var/log/apt/term.log) and the resulting files:dpkg -l chrony:ii chrony 4.5-1ubuntu4.2.dpkg --audit: clean.Omarchy Server: the updater, handed the terminal
47 pending packages, snapper
rootconfiguration present. Run from the TUI in tmux (p,U,y).Confirm dialog:
While the updater has the terminal, the pane shows the updater's own output, not the TUI, and it runs as a child of tui-update on the TUI's terminal:
After it exits (
COMMAND_EXIT_CODE="0", "Reboot? (not rebooting: unattended update)"), the screen is restored and the machine is read again (updates: 0 pending):No reboot (
up 14 minafterwards), and tui-update was still running.Found along the way, not changed here (pre-existing): the post snapshot then fails:
snapper create -t postneeds--pre-number <n>("Missing or invalid pre-number"). The pre/post pair has never been able to complete on a snapper machine. That is a separate issue with a design question (the pre number is only known at run time, after the preview), so this PR leaves it alone.🤖 Generated with Claude Code
https://claude.ai/code/session_01MbCfX3T8khyd9hsrN5kMo3