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
48.23k stars 2.86k forks source link

Open with + Zed session restore = same project opened twice #5919

Closed rkusa closed 1 year ago

rkusa commented 1 year ago

Check for existing issues

Describe the bug / provide steps to reproduce it

You usually only want each project (folder) opened once (so only in one Zed window). I've confirmed this assumption by

  1. Open project X
  2. Open "Recent projects"
  3. Select project X again → not opened in a second window, as it was already opened

However, in the following scenario, the same project is opened twice:

  1. Open project X
  2. Quit Zed (without closing the project X window)
  3. Use Open with to open project X in Zed, eg. via open -a /Applications/Zed.app projextX → Zed now restores the previous session, but also opens a new window for project X, which leads to the same project being opened twice

Interestingly, this is not the case if I run zed projectX instead of open -a /Applications/Zed.app projextX.

I've personally noticed this because I tend to open my projects via Raycast quicklinks (which is the Open with in this case):

Screenshot_2023-01-26_at_09 00 30

Environment

Zed: v0.71.3 (stable) OS: macOS 13.2.0 Memory: 16 GiB Architecture: aarch64

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

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

No response

mikayla-maki commented 1 year ago

This will be fixed in a few releases :)