Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zed window should remember last window size and position when opening single files #5258

Open
1 task done
Tracked by #7371 ...
ksandvik opened this issue Aug 1, 2022 · 62 comments · Fixed by #9416
Open
1 task done
Tracked by #7371 ...

Zed window should remember last window size and position when opening single files #5258

ksandvik opened this issue Aug 1, 2022 · 62 comments · Fixed by #9416
Labels
enhancement [core label] priority request A request from a stakeholder or influential user serialization Restoration of the editor state after a restart workspace Feedback for workspace management, layout, interactions, etc

Comments

@ksandvik
Copy link

ksandvik commented Aug 1, 2022

Check for existing issues

  • Completed

Describe the bug

When opening Zed it should remember previous window size and position when Zed was closed.

To reproduce

  1. Open Zed, set expected window size and position.
  2. Close Zed.
  3. Open Zed again.

Expected behavior

Expected: previous window size/position is honored.
Now: Using same size and location at startup.

Environment

Zed 0.49.1 – /Applications/Zed.app \nmacOS 12.5 \narchitecture x86_64

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

No response

@ksandvik ksandvik added defect [core label] triage Maintainer needs to classify the issue labels Aug 1, 2022
@JosephTLyons JosephTLyons added workspace Feedback for workspace management, layout, interactions, etc and removed triage Maintainer needs to classify the issue defect [core label] labels Aug 1, 2022
@mikayla-maki
Copy link
Contributor

@rsms
Copy link

rsms commented Aug 9, 2022

+1 — this is going to sound ridiculous, but it's a blocker for adaptation for me as I open a lot of temporary windows in my workflow (currently using Sublime.)

@iamnbutler
Copy link
Member

+1 — this is going to sound ridiculous, but it's a blocker for adaptation for me as I open a lot of temporary windows in my workflow (currently using Sublime.)

I don't think it is ridiculous, it is a pain to reset everything up every time.

@jbergstroem
Copy link

jbergstroem commented Oct 21, 2022

This and a "recent" file menu (#77) is adding unnecessary friction to getting started with my work. Hard to measure the pain threshold, but its in the back of my mind every time I open Zed.

@benonymus
Copy link

An option to "reopen where left off" (last project and files open from before last close) would also be lovely!

@emlynmu
Copy link

emlynmu commented Nov 17, 2022

This was the first thing I noticed when I launched the app. I'm glad to see other people care. The mention of serializable workspaces (#430) makes me worry about it being tied to saving a workspace. I basically only care about the default new window size which I would think would be tied to a new (unsaved) workspace.

@chriskrycho
Copy link

I just came here to say the exact same thing as @emlynmu – this should be separate behavior from serializing workspaces. On macOS, whenever you open a new window of an existing (well-behaved) application, it matches the size of the most recent1 window. It should also open in a new position, offset down-and-to-the-right (with "wrapping" that respects positions of existing windows) behavior.

Here's how it looks with VS Code (it took them years to get to it, but they finally did 😂):

CleanShot.2022-11-17.at.10.06.38-converted.mp4

Footnotes

  1. ish, there are subtleties; it's something like "most recent window which actually had focus" or "root window" when you have a hierarchy of windows etc.

@mikayla-maki
Copy link
Contributor

Thanks for the behavioral explanation @chriskrycho! :D

@mikayla-maki mikayla-maki mentioned this issue Dec 4, 2022
48 tasks
@JosephTLyons JosephTLyons added the serialization Restoration of the editor state after a restart label Jan 5, 2023
@JosephTLyons
Copy link
Contributor

This should go out with v0.72.0.

@chriskrycho
Copy link

I regret to say: This is not quite fixed in 0.72.x, though it took a big step forward: It is fixed when saving workspaces, and appears to remember the position used for a specific folder, but the feature request here is for a muuuuuch more general feature! See e.g. my example above—and note as well that you can trivially reproduce this by just opening any folder and then opening any new window!

@stjepangolemac
Copy link

If I close Zed while fullscreen it still won't start in fullscreen mode. It would improve consistency if it would remember the mode across restarts.

@stjepangolemac
Copy link

stjepangolemac commented Jan 17, 2024

Bump, cc @JosephTLyons

@widersky
Copy link

I think it would be ideal if the new editor window had the dimensions of the recently opened project window. Don't like it when a 'clean' window takes up the entire desktop.

@mikayla-maki mikayla-maki reopened this Jan 18, 2024
@JosephTLyons JosephTLyons added the enhancement [core label] label Jan 22, 2024
@michealp-coder
Copy link

michealp-coder commented Jan 24, 2024

This is a problem for me as well (running v0.119.16), and super annoying as well.

I don't have any projects open. When I launch Zed, it's to an empty/blank new file window.

I'll adjust the size and location of the new file window, to my liking. I then close Zed.

When I reopen Zed, the window doesn't have the previous size/location of the window and instead reverts to being max width/height of screen.

CC: @mikayla-maki @JosephTLyons

(Thanks for all the great work on Zed)

@JosephTLyons JosephTLyons transferred this issue from zed-industries/community Jan 24, 2024
@NicoAdrian
Copy link

@mikayla-maki hello, any update on this matter ? :)

@michealp-coder
Copy link

@mikayla-maki

any updates on this?

(thanks again in advance for creating such a great product)

@mekedron
Copy link

mekedron commented Apr 22, 2024

Now a new file always opens in a small window in a center of the screen. And because of that it makes it very annoying to use Zed for quick file edits as every time when you open a new file you need to manually open it in a full-screen.

@michealp-coder
Copy link

@mikayla-maki

any updates on this?

(thanks again in advance for creating such a great product)

@michealp-coder
Copy link

@JosephTLyons

Sorry to bug, but any updates on this?

@michealp-coder
Copy link

@JosephTLyons

Any updates on this ticket?

@jonathanperis
Copy link

Just started to try Zed and this is the very first issue that I got. Any expectations on fix this? Using 0.169.3 here

@michealp-coder
Copy link

@mikayla-maki any updates on this

Ahh, that’s a different use than I was looking at 😅, thanks for the video! I’ll look into this some more.

@mikayla-maki

You mentioned 3-months ago you'd look into this more. Any updates?

@michealp-coder
Copy link

@JosephTLyons will someone be reassigned to this ticket given that @mikayla-maki indicated in the thread above 3-months ago that they would look into this bug but never followed up?

@zoto-ff
Copy link

zoto-ff commented Jul 3, 2024

why hasn't it been fixed yet? this is probably the most annoying issue in Zed

@RustoMCSpit
Copy link

why hasn't it been fixed yet? this is probably the most annoying issue in Zed

be patient. also i actually like how it doesnt, so it my mind it should be an option

@michealp-coder
Copy link

why hasn't it been fixed yet? this is probably the most annoying issue in Zed

be patient. also i actually like how it doesnt, so it my mind it should be an option

Given that no one is any longer assigned to this issue, we're going to have to be very patient indeed.

@mrnugget
Copy link
Member

mrnugget commented Jul 4, 2024

why hasn't it been fixed yet? this is probably the most annoying issue in Zed

It's hard to reproduce and also works for a lot of people.

I also think there's a lot of different things being lumped together subconsciously:

  1. Creating new windows (cmd-n)
  2. Opening Zed and it automatically reopening the last project
  3. Storing size for a given project
  4. Storing size for a given worktree

The video you provided @michealp-coder was already very helpful.

One ask for everybody in this ticket:

  1. Can you provide detailed steps on how to reproduce the issue, that start with zed not running?
  2. Can you reproduce the issue when you start with an empty Zed database?

In order to test (2) you can do the following:

# 1. Close Zed
# 2. Move `0-stable` database (or `0-preview` if you run Preview) to home dir
mv ~/Library/Application\ Support/Zed/db/0-stable ~/0-stable-backup
# 3. Start Zed
# ... reproduce bug etc. etc. 
# 4. Quit Zed
# To restore DB, do the reverse:
mv ~/0-stable-backup ~/Library/Application\ Support/Zed/db/0-stable 

@NicoAdrian
Copy link

NicoAdrian commented Jul 4, 2024

why hasn't it been fixed yet? this is probably the most annoying issue in Zed

It's hard to reproduce and also works for a lot of people.

I also think there's a lot of different things being lumped together subconsciously:

1. Creating new windows (`cmd-n`)

2. Opening Zed and it automatically reopening the last project

3. Storing size for a given project

4. Storing size for a given worktree

The video you provided @michealp-coder was already very helpful.

One ask for everybody in this ticket:

1. Can you provide detailed steps on how to reproduce the issue, _that start with zed not running_?

2. Can you reproduce the issue when you start with an empty Zed database?

In order to test (2) you can do the following:

# 1. Close Zed
# 2. Move `0-stable` database (or `0-preview` if you run Preview) to home dir
mv ~/Library/Application\ Support/Zed/db/0-stable ~/0-stable-backup
# 3. Start Zed
# ... reproduce bug etc. etc. 
# 4. Quit Zed
# To restore DB, do the reverse:
mv ~/0-stable-backup ~/Library/Application\ Support/Zed/db/0-stable 

How to reproduce:

  1. Open Zed
  2. Resize the window
  3. Quit Zed
  4. Open Zed

==> The window size is reset, i.e it doesn't remember the last window size.

Resetting the DB did not help

@mrnugget
Copy link
Member

mrnugget commented Jul 4, 2024

How to reproduce:

  1. Open Zed
  2. Resize the window
  3. Quit Zed
  4. Open Zed

==> The window size is reset, i.e it doesn't remember the last window size.

Resetting the DB did not help

That works for me:

screenshot-2024-07-04-15.36.54.mp4

Now the question is: what's different between what you do and what I do?

When you open Zed, for example, does it open a recent project?

@NicoAdrian
Copy link

NicoAdrian commented Jul 4, 2024

How to reproduce:

  1. Open Zed
  2. Resize the window
  3. Quit Zed
  4. Open Zed

==> The window size is reset, i.e it doesn't remember the last window size.
Resetting the DB did not help

That works for me:
screenshot-2024-07-04-15.36.54.mp4

Now the question is: what's different between what you do and what I do?

When you open Zed, for example, does it open a recent project?

Ok I managed to make Zed remember the last window size. The issue is that I had no project openned ever:

Capture d’écran 2024-07-04 à 15 42 00

So this is the bug: when no project is openned, Zed can't remember last window size.

(Also another annoying bug is that when I right click on the folder name and then click on "remove from project", If I quit Zed et re-open it again, the project is openned again even though I removed it)

edit: If you want to reproduce, the only way I found to remove recently openned project is to uninstall Zed et reinstall

@michealp-coder
Copy link

How to reproduce:

  1. Open Zed
  2. Resize the window
  3. Quit Zed
  4. Open Zed

==> The window size is reset, i.e it doesn't remember the last window size.
Resetting the DB did not help

That works for me:

screenshot-2024-07-04-15.36.54.mp4

Now the question is: what's different between what you do and what I do?

When you open Zed, for example, does it open a recent project?

@mrnugget

I think what's different is you're opening into an existing Project.

We are not. We don't have a project open. We're just opening individual files to edit them.

@mrnugget mrnugget changed the title Zed window should remember last window size and position Zed window should remember last window size and position when opening single files Jul 8, 2024
@notpeter notpeter mentioned this issue Jul 15, 2024
1 task
@michealp-coder
Copy link

Any progress on this bug?

@mrnugget
Copy link
Member

In some sense, yes. I did work a lot on the restoring of workspaces/windows in the past few weeks:

But I didn't get to this one yet. It's highly-related to this #15098 but it's really tricky, because in Zed a window without any workspace (i.e. a window that was created when opening a single file) is essentially identity-less and we need to change the system so that's not the case. I did have half a version of this working, but there's a ton of edge cases to pay attention to and so I went and worked on the other things first.

@name-changer
Copy link

I see a (probably related) bug on current Wayland/KDE (the distro is OpenSuse Tumbleweed): when Zed (0.152.3) is not maximized, and I close and open the application, the window 'grows' bigger by a few pixel (maybe 20-30 or so, so it's quite noticeable).

After closing and opening a few times, I can't see the statusbar at the bottom anymore, because the window grows bigger than my current resolution. Since I typically only maximize my editor windows vertically, but not horizontally, this is a bit annoying, since I now have to periodically resize the way too large window.

@mrnugget
Copy link
Member

@name-changer can you create a separate issue for that?

@name-changer
Copy link

@mrnugget : Done #17870

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] priority request A request from a stakeholder or influential user serialization Restoration of the editor state after a restart workspace Feedback for workspace management, layout, interactions, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.