Skip to content

Keep symlinked terminal configs linked when changing font or text size - #14343

Closed
alive-zk wants to merge 2 commits into
omacom:quattrofrom
alive-zk:fix/terminal-config-symlinks
Closed

alive-zk wants to merge 2 commits into
omacom:quattrofrom
alive-zk:fix/terminal-config-symlinks

Conversation

@alive-zk

@alive-zk alive-zk commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Summary

omarchy-font-set and omarchy-display-text-size edit the alacritty, Ghostty and foot configs with plain sed -i. GNU sed's -i writes a temporary file and renames it over the path, so when one of those configs is a symlink into a dotfiles checkout, the link is replaced by a regular file. Later edits land in the copy, the dotfiles target goes stale, and the next dotfiles sync either overwrites the change or reports a conflict. It happens even when the substitution changes nothing.

Both commands already pass --follow-symlinks for kitty's config (since 4cb9c75). This applies the same flag to the other six edits, so the change is written to the link target and the link stays.

Notes

  • --follow-symlinks changes nothing for regular files, so setups without symlinked configs behave as before.
  • omarchy-display-text-size also detaches a symlinked shell.toml through its mktemp + mv rewrite. Preserve shell.toml symlinks and metadata when changing text size #13990 covers that, so this PR leaves it alone to avoid a conflict.
  • Seen on Omarchy 4.0.4: a dotfiles-linked ~/.config/ghostty/config and ~/.config/foot/foot.ini were both replaced by regular files with identical content, 10 ms apart.

Verification

  • New test/shell.d/terminal-config-symlink-test.sh links the stock alacritty, Ghostty and foot configs from a fake dotfiles directory, runs both real commands against stub binaries, and asserts that the links survive and that the targets receive the new font and size. On quattro it fails at the first assertion (alacritty/alacritty.toml stays a symlink); with this change it passes.
  • test/shell.d/kitty-config-test.sh still passes.
  • ./test/all, run headless (Wayland and Hyprland variables unset, so compositor tests skip): the CLI suite passes and 298 of 306 shell test files pass. The other 8 fail identically on an unmodified quattro checkout on the same machine: config, passwordless-grant-lifecycle, snapper and unowned-system-paths need the omarchy-pkgs companion checkout, and elsewhen-migration, elsewhen-pointer, launch-browser and panel-key-catcher fail the same way without this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Fvz7Kw8Ege88ZXUBR5MR7C

omarchy-font-set and omarchy-display-text-size edited the alacritty,
Ghostty and foot configs with plain sed -i, which replaces a symlinked
config (a dotfiles checkout) with a regular file. Kitty's edits already
pass --follow-symlinks; use it for the other three terminals too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fvz7Kw8Ege88ZXUBR5MR7C
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change is limited to font and text-size edits for three terminal configs.

The command changes appear safe, but the test must follow the repository's requirement to extend the existing test before merging.

Findings

  1. P2 Font tests repeat setup ▶

Summary

Both font commands now preserve symlinked Alacritty, Ghostty, and Foot configs by adding --follow-symlinks to six edits.

  • Font and text-size changes keep terminal config links connected.

Reviews (2) · Last reviewed commit: "Merge quattro into fix/terminal-config-s..." · Reviewed by Greptile

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything seems fine, ready to merge.

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review labels Oct 16, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 6dc71b8 and verified on a fresh Omarchy worker: the fix works, and nothing in the diff needs changing.

Reproduction. I wrote a separate check rather than relying on the included test. It links the stock alacritty, Ghostty and foot configs from a dotfiles directory, then runs omarchy-font-set, omarchy-display-text-size 20 and omarchy-display-text-size reset in a throwaway HOME. On current quattro (8a787b6), every command replaced all three links with regular files, and the dotfiles copies never got the new font or size. On this head, all three links survive every command and the targets get the new values (size = 15 / font-size = 15 / :size=15 at 20px, back to 9 on reset). With the six flags reverted on this head, all three links break again. A regular, non-symlinked Ghostty config is still edited in place as before. The new terminal-config-symlink-test.sh passes on the head and fails on quattro at alacritty/alacritty.toml stays a symlink. These six edits are the only writes either command makes to these three files.

Suite. ./test/cli passes. The full shell suite passes 299 of 306 files. The other 7 (ascii, branding-about-animation, network-captive-portal, network-owe-transition, passwordless-grant-lifecycle, runtime-smoke, screenshot-sanity) fail the same way on this branch with the fix reverted, so they are not caused by this change. Four of them also fail on current quattro on the same worker. The other three pass there, because this branch is behind quattro. Because the suite is not green, this is labelled verified and not ready.

Second opinion. Codex at medium effort reviewed the diff separately. It found no defects and agreed the change is proportionate and covers every edit to these three configs. It can read this session's working notes, so its agreement is not guaranteed to be independent.

Overlaps, for the maintainer. #15060 removes the Ghostty font-size edit in omarchy-display-text-size that this PR changes, and #13990 rewrites shell.toml handling in the same file. Neither fixes this bug. If #15060 lands first, this PR's Ghostty hunk and the test's font-size = 12 assertion will need dropping.

Waiting on the maintainer.

@TheAdamBorek

Copy link
Copy Markdown

Just reporting I had the same issue and wanted to land a PR to fix it. I'm not opening a new issue as Claude has found this one!

Are you guys going to merge it? :)

omarchybot added a commit to calebdw/omarchy that referenced this pull request Oct 31, 2026
From omacom#14343: link the stock alacritty, Ghostty and foot configs from a dotfiles directory, run the real omarchy-font-set and omarchy-display-text-size, and check the links survive and the edits land in their targets. sed-follow-symlinks-test.sh only checks the flag is spelled; this fails on quattro for the reason the fix exists. It extends the test that already drives both commands rather than adding a file.

Co-Authored-By: Ali Yahya <alive@outlast.me>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
quattro now reads foot's primary font size before rewriting the font line; keep that, and write it with --follow-symlinks like the other terminal config edits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines +6 to +10
test_dir=$(mktemp -d)
trap 'rm -rf "$test_dir"' EXIT
test_home="$test_dir/home"
dotfiles="$test_dir/dotfiles"
configs=(alacritty/alacritty.toml ghostty/config foot/foot.ini)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Font tests repeat setup

The new test repeats setup already in test/shell.d/kitty-config-test.sh, which runs both font commands. AGENTS.md requires extending the area's existing test rather than adding another *-test.sh. Move these symlink checks into that file before merging so the shared setup stays in one place.

File Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

quattro moved on and this stopped merging cleanly, so I merged quattro 4761d7b into your branch as e3923d8 (no rebase or force push). It merges cleanly now.

The one conflict was in bin/omarchy-font-set. quattro now keeps the size foot already has instead of resetting it to 9. I kept that and added --follow-symlinks to its sed -i, so the six edits are the same as before.

Tested on a fresh Omarchy worker:

  • terminal-config-symlink-test.sh fails on quattro and on this head with the two commands reverted, and passes at e3923d8.
  • A symlinked foot.ini at size=12 run through omarchy-font-set stays linked here, and the dotfile gets the new font at size 12. On quattro the link is replaced by a regular file.
  • test/cli passes. In the full test/shell.d suite, five files fail at this head (agent-account-exec, ascii, branding-about-animation, first-run, runtime-smoke). All five also fail on quattro.

Second opinion: Codex Medium and muse-wonder (pi, thinking high) reviewed the merge and found nothing to change. They agreed with my reading, and their independence is not guaranteed.

#7309 overlaps this. It is older (opened 2026-08-17) and makes the same six --follow-symlinks edits in omarchy-font-set and omarchy-display-text-size, along with the rest of the repository's sed -i calls. Since 2026-10-31 it also carries your test, moved into kitty-config-test.sh and credited to you as co-author. Neither fix has a defect for this bug, and the older fix wins by default, so #7309 is the one carried forward. Both reviewers reached the same answer when asked without mine. This stays verified but not ready. #7309 has scope questions the maintainer still has to settle, and if they decide against the broad sweep, this PR is the smaller fix for the same bug.

@TheAdamBorek, thanks for confirming you hit this too.

This waits on the maintainer.

@dhh

dhh commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Thank you @alive-zk! Preserving symlinked terminal configs in bin/omarchy-font-set landed in #19969, and the remaining bin/omarchy-display-text-size fix and regression test have been extracted with credit into #20002.

@dhh dhh closed this Nov 24, 2026
dhh added a commit that referenced this pull request Nov 24, 2026
…troArch commands (#20002)

* Preserve symlinked user configs in text-size, glass, Sunshine, and RetroArch commands

Extracted from #14343 and #7309 on top of #19969.

Co-authored-by: Ali Yahya <alive@outlast.me>
Co-authored-by: Caleb White <cdwhite3@pm.me>

* Write through symlinked shell.toml in omarchy-display-text-size

Co-authored-by: Ali Yahya <alive@outlast.me>
Co-authored-by: Caleb White <cdwhite3@pm.me>

---------

Co-authored-by: Ali Yahya <alive@outlast.me>
Co-authored-by: Caleb White <cdwhite3@pm.me>
cursor Bot pushed a commit to mark-groves/omarchy that referenced this pull request Nov 24, 2026
…troArch commands (omacom#20002)

* Preserve symlinked user configs in text-size, glass, Sunshine, and RetroArch commands

Extracted from omacom#14343 and omacom#7309 on top of omacom#19969.

Co-authored-by: Ali Yahya <alive@outlast.me>
Co-authored-by: Caleb White <cdwhite3@pm.me>

* Write through symlinked shell.toml in omarchy-display-text-size

Co-authored-by: Ali Yahya <alive@outlast.me>
Co-authored-by: Caleb White <cdwhite3@pm.me>

---------

Co-authored-by: Ali Yahya <alive@outlast.me>
Co-authored-by: Caleb White <cdwhite3@pm.me>
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.

5 participants