Commit Graph
5 Commits
Author SHA1 Message Date
Menghuan1918 7a30d74cdf merge #612 into dev(WSL 下外部打开:绝对路径调用 Windows explorer/rundll32,VS Code/Cursor 的 file URL 转 Remote-WSL,spawn 失败不再被吞)
#612 严格覆盖 #575:两者都做 WSL 检测与 reveal 走 Windows Explorer,但 #575 用
`explorer.exe` 裸名 + 往子进程 PATH 追加 /mnt/c/WINDOWS,而 #612 先用绝对路径
`/usr/bin/wslpath -u` 解析 Windows 可执行文件,因此在 appendWindowsPath=false
(issue #591 的实际环境)下同样成立;#612 另加 issue #591 点名的第二半:URL 侧
改走 Windows rundll32 协议处理器、vscode/cursor 的本地 file URL 转
`vscode-remote/wsl+<distro>`,以及把原先被 `child.on('error')` 吞掉的启动失败
改成 reject 路由。#575 相对 #612 没有任何独有能力,按被超集取代处理。

解冲突(唯一冲突文件 tests/open-external.spec.ts,两侧插在同一锚点,两段都留):
- describe('revealCommand'):dev 的 android/termux-open 用例 + PR 的 wsl 用例;
- describe('urlCommand'):dev 的 android/termux-open-url 用例 + PR 的 wsl 用例
  与新增的 describe('wslRemoteEditorUrl') 整块。
src/open-external.ts 三方合并干净(dev 的 case 'android' 与 PR 的 if (options.wsl)
分支共存)。

Refs #612
Refs #591
2026-10-05 01:53:26 +08:00
240xu eb37f933d3 fix(open-external): support Termux (platform android) openers
On Termux — the dominant Node runtime that reports process.platform
'android' — both external-open actions fell through to xdg-open, which
does not exist there, so 'reveal in file manager' and custom-scheme URL
opens failed silently (the spawn error is swallowed by design).

- revealCommand: case 'android' → termux-open on the containing
  directory (no desktop file manager and no select protocol on Android;
  same parent-dir KISS as the Linux branch)
- urlCommand: case 'android' → termux-open-url (the URL intent
  dispatcher; termux-open would route URLs through the content chooser)

Command builders stay pure — the platform remains injectable and the new
branches are unit-tested like every other platform.
2026-09-26 20:23:33 +08:00
Kunping Wang 5a733e91f1 fix(open-with): 支持 WSL 外部打开操作 2026-09-14 15:30:21 +08:00
yangkun ac02598150 fix: preserve Windows explorer reveal selection 2026-09-02 10:27:43 +08:00
Atlas Zeng 22a5d372be feat(editor): 文件树「在应用中打开」子菜单(外部编辑器/图钉固定/SSH 远端/自定义编辑器) (#334)
* feat(editor): file tree 'open with' submenu (external editors, pin, SSH-remote, custom editors)

The file tree right-click menu gains an 'Open with >' submenu with the
resource manager (reveal in file manager), VS Code, Cursor and Zed, plus
user-defined custom editors (name + URL template + VSCode-family flag).
Each submenu row carries a pushpin that promotes the target to a direct
top-level menu item.

A configurable SSH host (settings: Files card gear) switches VSCode-family
openers to <scheme>://vscode-remote/ssh-remote+<host>/<path> and hides
host-local targets (file manager / Zed / non-VSCode custom editors).

External opens run through the new fenced /sidebar/api/open.external route
which spawns the platform opener with an argv array (no shell); the client
never navigates raw scheme URLs itself. The settings seam's render panel now
appends after the declarative rows instead of replacing them.

* feat(editor): polish open-with menu UI — brand icons, pushpin, chevron, row alignment

- Submenu rows: the custom label is now a block-level flex row filling the
  primitives itemLabel, so the pushpin docks at the row's far right (matching
  the trailing check of every other menu); menu row icons normalized to 16px
  (DSH native menus use 16, ours were 14).
- The submenu parent row gains a right-aligned chevron (the primitives Menu
  renders no arrow for submenu parents).
- Icons via react-icons: codicons VscPin/VscPinned pushpins (replacing the
  hand-drawn pin), VscFile/VscFolder/VscFolderOpened tree glyphs (replacing
  the </> file mark), VscLinkExternal for the open-with parent and the
  browser tab's open-external button (globally), SiCursor/SiZedindustries
  brand silhouettes; the VS Code mark is inlined from simple-icons@11.0.0
  (CC0) as IconVscode16 since later simple-icons releases dropped it. All
  monochrome currentColor to follow the active skin.
- tsdown: pin react-icons si/vsc to their ESM entries via resolve.alias —
  the package's exports map lists require before import, so the shared
  conditionNames picked the unshakeable CJS entry and bloated the core
  bundle by ~6.4 MB; tree-shaken it now adds only ~12 KB.
2026-08-22 23:19:17 +08:00