zed icon indicating copy to clipboard operation
zed copied to clipboard

Reopen previous ZED state, while opening a new file

Open krstp opened this issue 2 years ago • 4 comments

Check for existing issues

  • [X] Completed

Describe the feature

  • Currently ZED remembers the previous UI (tabs etc.) state when opening ZED (call it ABC).
  • However, when opening fresh ZED by opening a different file (call it D), the previous ZED state (all open windows, project - ABC) is not opened as if all the windows/tabs were lost... not being able to bring back the previous project/tabs back.... only seeing the D file edit.
  • Now is an interesting plot... When quitting that newly opened window (D) with this different file edit (D) and reopening ZED fresh, it brings back not the previous last remembered window (D), but actually brings back the previous state (ABC) with all the project/tabs open, but now forgetting that previous the single file edit (D).

I hope it clarifies.

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

  • Initial project ABC:     ABC
  • close app with ABC state
  • open different D file: D
    • ABC does not get opened, but one would think it should as well
  • close app with D state
  • reopen app
    • ABC state reopens; D state gets lost ethernally. ABC

krstp avatar Apr 01 '23 15:04 krstp

To add to it, ZED generally does not remember the state of opened windows, such as multiple project windows or singled out files in stand-alone windows upon close are not remembered (which is really annoying). When ZED is reopened it will only open the the lastly defined/opened project window, which is kind of frustrating. 😮‍💨

Samples:

  • working projects sample: back-left: large project window, top-right: a file edit with terminal opened by default (other issue zed-industries/zed#6097), right-bottom: new project window (the most recently opened ZED project) Working_projects

  • sample after ZED close and reopen: notice back-left (main project) window and top-right edit-file disappear, while new right-bottom project is reopened. Reopened

In summary: ZED should remember the state of all opened projects, windows, and tabs, including terminal windows.

krstp avatar Apr 07 '23 14:04 krstp

I would actually like to prevent windows from a previous session on to open when I launch Zed... is there a way to stop that?

hernangonzalez avatar Feb 06 '24 11:02 hernangonzalez

+1 for @hernangonzalez request. I'd like to start Zed with no projects/folders open (akin to hotexit and restorewindows options in VS Code.

serdar avatar Feb 13 '24 23:02 serdar

If you open up the file explorer in Zed, you will find that the files that keep reappearing in tabs are actually in your project! You can right click and remove from project in the Zed file explorer, then they wont appear upon opening Zed next time.

Didn't realise straight away what was happening myself, as I rarely use the Zed explorer and usually drag files into the editor window or open files in Zed from the CLI directly, which doesn't then have this happen.

fred-sheehan avatar Mar 01 '24 19:03 fred-sheehan

@fred-sheehan Not actually. It keeps opening the project even after removing it!

mehdiataei avatar Mar 20 '24 17:03 mehdiataei