Skip to content

Accept theme-set display names in theme remove - #7404

Closed
686f6c61 wants to merge 1 commit into
omacom:quattrofrom
686f6c61:theme-remove-normalize
Closed

686f6c61 wants to merge 1 commit into
omacom:quattrofrom
686f6c61:theme-remove-normalize

Conversation

@686f6c61

Copy link
Copy Markdown

Fixes #7127

omarchy theme set slugs a display name (My Theme → my-theme). omarchy theme remove used $1 as a directory name, so the form its own example advertised always failed. The interactive picker already passed directory names from find, so only the explicit argument path was wrong.

Apply the same sed/tr slug theme-set uses. Change the example from "Tokyo Night" (a bundled theme, which this command will not delete) to "My Theme".

Verified:

./test/shell.d/theme-remove-test.sh
# ok - theme remove accepts a quoted display name
# ok - theme remove still accepts a directory slug

theme set turns "My Theme" into my-theme. theme remove used the
raw argument, so the documented quoted name always missed. Apply
the same slug, and stop using a bundled theme in the example.
Copilot AI balanced review requested due to automatic review settings August 18, 2026 17:38

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Copy link
Copy Markdown
Collaborator

Reviewed at 01ad9ac, merged onto current quattro (b2ffea5; the merge is clean alongside the path-traversal guard that landed there since). The bug is real and this fixes it.

Reproduced on a disposable Omarchy worker. With ~/.config/omarchy/themes/my-cool-theme present, omarchy-theme-remove "My Cool Theme" fails on quattro with "Theme 'My Cool Theme' not found", removes the theme with this change, and fails again with the one-line fix reverted. A plain slug still removes, and .., ., ../../evil, .git, My Theme/.. and ../Evil Theme are all still refused, since the guard checks the slugged name. test/shell.d/theme-remove-test.sh, theme-install-guards-test.sh and user-theme-test.sh pass on the worker.

Suite. ./test/cli has one failure, vscode generated theme references current theme file. It fails identically on quattro without this change and is what #13065 fixes, so it is not caused here, but it keeps this from being marked ready until that lands. GitHub reports no CI checks for this head.

Second opinion. Codex (medium effort) read the change and found no defect; it agreed the fix is proportionate and matches the slug in omarchy-theme-set line 318 (independence is not guaranteed). It noted one narrow behaviour change: a hand-made directory with uppercase letters or spaces (say MyTheme) can no longer be removed by typing its literal name, though the interactive picker still removes it. omarchy theme install only creates lowercase names and omarchy theme set already cannot select such a directory, so I don't think it needs changing.

Nothing needed from you. #12385 also edits bin/omarchy-theme-remove, in a different hunk, and does not conflict. This is waiting on the maintainer, after #13065.

@686f6c61 686f6c61 closed this by deleting the head repository Nov 1, 2026
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.

omarchy theme remove rejects the quoted display name its own help text documents

3 participants