zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
45.94k stars 2.56k forks source link

Make 'Install CLI' usable without admin privileges #10065

Open liamdawson opened 5 months ago

liamdawson commented 5 months ago

Check for existing issues

Describe the feature

When I attempt to install the CLI without admin privileges, I would either like it to fall back to an approach that uses my home directory (e.g. install to ~/.local/bin or ~/bin), or to provide instructions on how to achieve this for myself.

Currently, it errors with:

error creating CLI symlink

Caused by:
error running osascript. Please try again.

I can install zed using Homebrew into ~/Applications, and Homebrew manages an appropriate symlink at /opt/homebrew/bin/zed for me, so this is a low priority issue for me.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

notpeter commented 2 months ago

Yeah, the messaging on that window isn't great:

Screenshot 2024-06-27 at 14 30 11

https://github.com/zed-industries/zed/blob/a695322f83f2ad5d8d462b732a7141755d70ebba/crates/zed/src/zed.rs#L291-L293

"Error installing zed cli" / "error creating CLI symlink" doesn't tell you where to go / what to do.

The instructions for how to create a directory, symlink, and manipulate your path are likely too much to do inline:

mkdir -p ~/.local/bin
ln -sf /Application/Zed.app/Contents/MacOS/cli ~/.local/bin/zed
# add to ~/.zshrc:
#   export PATH="$HOME/.local/bin/zed:$PATH"
# then respawn your shell

but I've included them here in case someone else finds this error and cannot do the normal sudo ln -sf /Application/Zed.app/Contents/MacOS/cli /usr/local/bin/zed.