Skip to content

feat: resolve renamed zed CLI on Linux - #175

Open
0froq wants to merge 2 commits into
vitejs:mainfrom
0froq:fix/zed-linux-binary-alias
Open

0froq wants to merge 2 commits into
vitejs:mainfrom
0froq:fix/zed-linux-binary-alias

Conversation

@0froq

@0froq 0froq commented Nov 18, 2026

Copy link
Copy Markdown

This description was drafted by an agent from the diff and the commands it ran.

Fixes #103

Description

Detection assumed the Zed CLI is named zed. Editor info on Linux now maps a process to a list of candidate commands, ['zeditor', 'zedit', 'zed'] for Zed, and getEditorFromLinuxProcesses returns the first candidate that exists in PATH. When none of them exist it still returns zed, so the existing error message is unchanged.

getArgumentsForFile matches the editor by basename, so zeditor and zedit fell into the default branch and dropped line:column. They now share the zed case.

Test

I only have macOS here, so this calls both functions directly, with a temp directory holding only an executable zeditor placed first in PATH:

$ node check.js

main:

detected: zed
args: [ '/home/me/app/index.js' ]

branch:

detected: zeditor
args: [ '/home/me/app/index.js:10:5' ]

Some distributions ship Zed's CLI as `zeditor` or `zedit` because `zed` is
taken by another package. Pick the first candidate that exists in PATH so a
renamed CLI still opens the file, and keep spawning `zed` otherwise.
`getArgumentsForFile` matched only `zed`, so a `zeditor` or `zedit` command
dropped the position suffix and opened the file at line 1.

This branch has not been deployed

No deployments
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.

Zed editor binary can also be called zeditor on some linux distros since zed is already taken

1 participant