Skip to content

Only restart the shell after Voxtype configure if the config changed - #12364

Closed
Yacl222 wants to merge 2 commits into
omacom:quattrofrom
Yacl222:fix/voxtype-config-conditional-restart
Closed

Yacl222 wants to merge 2 commits into
omacom:quattrofrom
Yacl222:fix/voxtype-config-conditional-restart

Conversation

@Yacl222

@Yacl222 Yacl222 commented Sep 18, 2026

Copy link
Copy Markdown

Summary

  • omarchy-voxtype-config always restarted the shell after closing the configure TUI, even when nothing was edited
  • The restart flashes the screen black for a couple of seconds, so just checking a setting and closing produced an unnecessary black flash
  • Compare a sha256 of config.toml before/after and only restart when it actually changed

Test plan

  • Opened omarchy-voxtype-config, closed without changing anything — confirmed no restart/flash
  • Opened omarchy-voxtype-config, changed a setting and saved — confirmed the shell still restarts

@llstrk

llstrk commented Sep 25, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Verified: With config.toml present, the hash gate behaves as described. Closing voxtype configure without changes skips the shell restart, and saved changes still restart it, including Voxtype's own save path (it writes config.toml.tmp and renames it over the config). The before/after comparison runs after the terminal closes on the default launch chain: the launcher runs as a child of the non-interactive script, so setsid execs in place instead of forking, and the default uwsm-app scope path, xdg-terminal-exec and foot also run in place.

One issue remains when the config file does not exist.

Missing config.toml stops the script before Voxtype opens

Under set -e, a plain assignment takes the exit status of its command substitution. When config.toml is absent, sha256sum fails, so before=$(sha256sum "$config_file" 2>/dev/null) ends the script with exit 1 and no output. voxtype configure never opens. An unreadable file or a dangling symlink takes the same path.

config.toml Base This PR
present, unchanged configure opens, shell restarts configure opens, no restart
present, changed configure opens, shell restarts configure opens, shell restarts
missing configure opens, shell restarts exits 1, configure never opens

Rows come from sandboxed runs with a stubbed launcher that simulates configure's file changes and a stubbed shell restart.

Impact: Voxtype's config editor supports a missing file: it loads an empty document and creates config.toml on first save (src/tui/config_editor.rs, Voxtype 1.1.0). omarchy-voxtype-install normally copies a default config, but the file is absent if the user removed it, installed Voxtype another way, or set XDG_CONFIG_HOME to somewhere other than ~/.config (the installer copies into ~/.config/voxtype). In that state, clicking the Dictation indicator or running omarchy voxtype config silently does nothing, where the previous script opened the configurator.

Suggested change: Let both hashes tolerate a missing file:

before=$(sha256sum "$config_file" 2>/dev/null || true)
...
after=$(sha256sum "$config_file" 2>/dev/null || true)

A diagnostic copy with this change opened the configurator in every tested case, restarted the shell when the file was created during the session, skipped the restart when it stayed missing, and matched this PR in every case with the file present.


Review information

Test scope: Source review of head 6445a89, plus sandboxed runs of the base and head scripts. One set used a stubbed launcher; another used the real launcher script and real setsid with stubs for uwsm-app, xdg-terminal-exec, the terminal, voxtype and omarchy-restart-shell. Blocking behavior of uwsm-app, systemd-run --scope, xdg-terminal-exec and foot is based on their source (uwsm 0.27.0, systemd 262, xdg-terminal-exec 0.14.3, Voxtype 1.1.0). Real Voxtype, terminals and the Omarchy shell were not run. Terminals that hand off to an existing instance and exit early were not examined.

AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

omarchy-voxtype-config always restarted the shell after closing the
configure TUI, even when nothing was edited. The restart flashes the
screen black for a couple of seconds, so just checking a setting and
closing produces an unnecessary black flash. Compare a sha256 of
config.toml before/after and only restart when it actually changed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Yacl222
Yacl222 force-pushed the fix/voxtype-config-conditional-restart branch from 6445a89 to fac7d84 Compare October 1, 2026 05:13
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes when the shell restarts after configuration.

The PR appears safe to merge; no outstanding blocking issue was identified.

Summary

The PR compares config.toml before and after the Voxtype configuration TUI, restarting the shell only when the file changes. The latest change allows the TUI to open even when the file cannot initially be hashed.

Reviews (2) · Last reviewed commit: "Open Voxtype configure when config.toml ..."

Comment thread bin/omarchy-voxtype-config Resolved
Under set -e an assignment takes its command substitution's exit status, so sha256sum failing on a missing config ended the script before voxtype configure opened. Voxtype's editor handles a missing file and creates it on save, so treat a missing file as an empty hash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at a59873d, and the fix holds: closing voxtype configure without changes no longer restarts the shell, and a saved change still does.

Pushed a59873d to your branch, fixing the problem Greptile and the earlier community review both raised: with config.toml missing, sha256sum failed under set -e and the script exited before voxtype configure ever opened, so the Dictation indicator did nothing. Both hashes now end in || true, so a missing file hashes as empty, the configurator opens, and a config created during the session still triggers the restart.

What ran, on a disposable Omarchy worker:

  • A reproduction with a stubbed launcher and restart, covering four cases each on quattro, your original head and this head. quattro restarts in every case. Your original head stopped restarting on an unchanged config but exited 1 with no window when the config was missing. This head opens the configurator in every case and restarts only when the file changed or was created.
  • The real launcher through uwsm-app and foot, with a stand-in voxtype configure that edits the config after four seconds. The launcher returned only after the terminal closed, the after-hash saw the edit, and the shell restarted. So the comparison really does run after the TUI closes.
  • ./test/cli stops at vscode generated theme references current theme file, which fails the same way on quattro at 8b4eae6, so the rest of the suite did not run. Nothing in the suite covers this script.

Second opinion: Codex at medium effort read the change and reached the same conclusions: the problem is real, the fix is proportionate, and the launcher waits for the terminal on the default path. Its independence from this review is not guaranteed. It raised two things I did not act on:

  • With UWSM_APP_UNIT_TYPE=service the launcher returns early, so a needed restart would be skipped. quattro has the same timing problem (it restarts before you have edited anything), so this PR does not introduce it.
  • It suggested unquoting "$after" in the [[ != ]] test to match house style. Quoting the right-hand side keeps it from being read as a glob pattern, so the quotes stay.

#13807 changes the same two lines of bin/omarchy-voxtype-config, and its new test expects a restart after every configure. Whichever of the two lands second will need reconciling with the other.

This is now waiting on the maintainer, and on the suite failure on quattro being fixed.

@ryanrhughes

Copy link
Copy Markdown
Collaborator

Closing this one; that shell restart only existed to refresh the bar's Dictation indicator, and #14552 removed the indicator. Skipping the restart when nothing changed was the right instinct, though. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants