Skip to content

Use subl for the Sublime Text default editor - #9656

Merged
bjarneo merged 2 commits into
omacom:quattrofrom
chessing234:fix/sublime-default-editor-uses-subl
Sep 21, 2026
Merged

bjarneo merged 2 commits into
omacom:quattrofrom
chessing234:fix/sublime-default-editor-uses-subl

Conversation

@chessing234

@chessing234 chessing234 commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • sublime-text-4 puts subl on PATH, not sublime_text, so Defaults → Editor hid Sublime and omarchy-launch-editor fell back to Neovim.
  • Store and launch subl, map a legacy sublime_text default, and gate the menu row on subl.

Fixes #9643

Test plan

  • After installing Sublime, Defaults → Editor lists Sublime Text
  • Choosing it writes subl and omarchy-launch-editor opens Sublime
  • An older sublime_text default file still launches via subl

Signed-off-by: Taksh <takshkothari09@gmail.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed by Claude Opus 5, with an independent second opinion from Codex at xhigh reasoning. Tests were executed on a disposable Omarchy VM rather than only read.

The premise holds. I pulled the AUR sublime-text-4 PKGBUILD: the only thing it installs into /usr/bin is install -Dm755 "${pkgname}.sh" "${pkgdir}/usr/bin/subl". sublime_text survives as the desktop id (/usr/share/applications/sublime_text.desktop) and as the Hyprland window class. You left default/hypr/apps/system.lua:18 and the install.editor.sublime row at omarchy-menu.jsonc:232 alone, which is right — neither of those means the PATH command. No production call site is missed.

Two things fail the suite as it stands.

1. default/omarchy/omarchy-menu.jsonc:167 — the new "when":"omarchy-cmd-present subl". test/shell.d/menu-test.sh asserts that no row under Defaults > Browser/Terminal/Editor carries a when, and this trips it: not ok - menu always exposes every supported browser, terminal, and editor under Defaults. That assertion is deliberate rather than incidental — selecting a missing editor is how you install it, since omarchy-default-editor runs omarchy-pkg-add sublime-text-4 when the command is absent (bin/omarchy-default-editor:39-52). Gating the row on subl removes that path, so a user who has not installed Sublime yet can no longer pick it. The when quoted in issue #9643 is from 4.0.1; quattro has since dropped it on purpose.

2. test/shell.d/default-apps-test.sh still asserts the old name. Line 172 is 'sublime_text sublime_text pkg:sublime-text-4' while the script now persists subl, so the check at line 296 fails: not ok - sublime_text becomes the default editor after installation. The installer mock at line 72 (sublime-text-4) command=sublime_text) needs the same update.

Ran on the worker at 8c30349:

  • ./test/cli — 116 passed, exit 0
  • ./test/shell.d/default-apps-test.sh — 8 passed, 1 failed, exit 1
  • ./test/shell.d/menu-test.sh — 51 passed, 1 failed, exit 1

One thing this does not handle, and neither does #9673: anyone who already selected Sublime has sublime_text in ~/.local/state/omarchy/defaults/editor. Your remap in omarchy-launch-editor means it still launches, which is the half that matters — but omarchy-default-editor with no arguments still prints sublime_text, so the checked comparison against subl is false and the row shows unticked until they reselect. Which way to close that (normalize the getter, accept both values in checked, or add a migration under migrations/) is a design choice, so I have not pushed anything for it.

Codex agreed with both failures and with the call-site classification, and rejected nothing; its independence is not currently guaranteed, since it can read this session's own transcript. It contributed nothing here beyond agreement.

Nothing pushed to this branch. #9673 fixes the same issue with the same production change, without the when guard and with default-apps-test.sh updated; which to take is the maintainer's call, not mine.

@chessing234

Copy link
Copy Markdown
Contributor Author

@dhh @ryanrhughes ready for review

A when: subl guard hid the row before install, which is how the editor
gets packaged. Map stored sublime_text to subl so an existing default
stays ticked, and update the default-apps tests for the PATH name.
@chessing234

Copy link
Copy Markdown
Contributor Author

dropped the when: subl guard so sublime still shows up to install, and mapped stored sublime_text to subl for the checkmark.

@laodzuh laodzuh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested on real hardware: Omarchy 4.0.4-1, sublime-text-4 4.4200-1 from [omarchy], Intel i7-7700 / GTX 1070, with no sublime_text shim on PATH (confirmed command -v sublime_text fails, only /usr/bin/subl exists).

  • bash test/shell: default-apps-test.sh passes all 11 cases. 4 unrelated files fail locally (3 need an omarchy-pkgs checkout, runtime-smoke-test.sh collides with my live shell) — same on quattro, not this branch.
  • With the branch's bin/ first on PATH: a pre-existing stored sublime_text reports as subl with no migration; omarchy-default-editor sublime_text persists subl; omarchy-launch-editor <file> opens Sublime instead of falling back to nvim.
  • Loaded the changed setup.default.editor.sublime row via the user menu extension: Sublime Text appears under Setup > Default > Editor and shows the checkmark.
  • Confirmed the install.editor.sublime third arg is correctly left as sublime_text: omarchy-install-and-launch hands it to gtk-launch, and the package ships /usr/share/applications/sublime_text.desktop, so that's the desktop ID, not the binary.

Also resolves #12787 (closed as a duplicate of #9643).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sublime Text install does not expose sublime_text on PATH, so Defaults → Editor never lists it

5 participants