Skip to content

Use subl for the Sublime Text default editor - #9656

Open
Chessing234 wants to merge 1 commit into
omacom:quattrofrom
Chessing234:fix/sublime-default-editor-uses-subl
Open

Use subl for the Sublime Text default editor#9656
Chessing234 wants to merge 1 commit 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.

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

2 participants