Closed mattbanks closed 7 years ago
Here's my current settings.json
for reference:
{
"editor.fontSize": 14,
"editor.lineHeight": 22,
"editor.fontFamily": "Hack, monospace",
"editor.scrollBeyondLastLine": false,
"editor.minimap.enabled": false,
"editor.wordWrap": "on",
"editor.dragAndDrop": true,
"xo.enable": true,
"workbench.welcome.enabled": false,
"workbench.colorTheme": "Material Theme",
"workbench.iconTheme": "material-icon-theme",
"window.reopenFolders": "none",
"window.newWindowDimensions": "inherit",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/.DS_Store": true,
"**/node_modules": true
}
}
@mattbanks setting it to inherit only means having a window open and then opening a new one should inherit that dimension. Is that what you are doing?
@bpasero Yeah, before this update new windows would open where the previous window was and at the same size. Now they're all in the default position and the default size, so I have to resize and move every editor window I open. This used to work when I run code .
in terminal for a directory, every window would open at the same size/location. Now that no longer works.
@mattbanks to be clear, you start with one window, you move it around/size it, then you close and then you start again and it does not position where it left off?
I just tried with your settings and cannot reproduce. Proof:
@bpasero correct. I'm going to try to take a screencast (I don't have screenflow installed on this machine). I open a window with code .
, make it larger and move it to my external monitor. If I close the windows and run code .
again, I get a new window in the default centered position with smaller size on my MacBook Pro screen.
@mattbanks I wonder if this is multi monitor related, also try with single monitor.
@bpasero just tried only on my MacBook Pro (external monitor was still connected, but only used laptop screen.
Here's a gif (rather large, so not embedding here): http://mattbanks.me/assets/img/random/code-window-issue.gif
@mattbanks but you are not moving the window out of the desktop size somehow right? because on startup we try to validate the stored window dimensions and restore it only if they are valid.
And can you try again the same thing with a 1.10.x install to see if this is a regression? Grab it from https://az764295.vo.msecnd.net/stable/8076a19fdcab7e1fc1707952d652f0bb6c6db331/VSCode-darwin-stable.zip
@bpasero Nope not dragging out out desktop size. It was out of that gif/video window, but resized to fit before closing.
I'll grab v1.10.x now and try it.
@bpasero confirmed it works if I downgrade to v1.10.x from the link you sent. After upgrading back to 1.11.1 (direct download from https://code.visualstudio.com/), I'm seeing the incorrect behavior again.
@mattbanks ok back to 1.11.1, what happens when you run "code --user-data-dir <some empty folder>
" to bypass any settings and cached data?
@bpasero It opens in the default position/size every time when passing the --user-data-dir
flag. I tried with an two different empty dirs and also opened again with those dirs after resizing.
@mattbanks ok I am running out of ideas. If you are willing to run VS Code from its sources (setup here: https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source) I could give you some pointers where to add logging.
@bpasero sure I can definitely do that! I'll have to wait until Monday to get that setup - need to finish up a project today :)
@mattbanks awesome! let me know when you are ready
I'm having the same problem on xubuntu 16.04. But it also happens when setting "window.newWindowDimensions": "maximized"
.
Switching to "maximized" works for me, it's just "inherit" that doesn't work. @bpasero sadly I still haven't had a chance to take a look at debugging this, as some projects are still ongoing for me. I'll take a look as soon as I can!
window.newWindowDimensions
is only for opening new windows, not for the initial one (hence the name). the initial one always restores its dimensions from the previous session.
@bpasero , when double click the top blank area on new maximized windows, can we make its dimension the same with previous session?..
That sounds like a separate feature request unrelated to the window.newWindowDimensions
setting.
I'm having this same issue. window.newWindowDimensions: "inherit"
works just fine if I have an existing window and I open a new window. But if I close all windows, and then open a new one, it behaves like "default"
. This is very annoying.
macOS 10.12.4 (16E195), VS Code 1.11.2
Reopening as after reading the comments again I think the real issue is not related to the window.newWindowDimensions
setting but rather that we fail to restore the location of the previously closed window.
@mattbanks @obedm503 @King66 @kballard @GoodGuyNick to ensure we are all talking about the same thing can you do an experiment such as:
code --user-data-dir <some empty folder>
=> does the window restore to where you put it or not? => any difference when using multiple monitors (if you are using multiple at all)?
Here is how it works for me:
@bpasero does the window restore to where you put it? => yes, same with you(one monitor, 1920x1080)
By the way, I'm using the inherit setting now. With the inherit setting, it works fine almost always(window will restore size). I just met once the window open with a size about 1010x761(default size, too small, not the size I use). I can't reproduce now..
@King66 can you explain where your remaining issue still is please? So it is unrelated to the first window restoring you say?
@mattbanks @obedm503 @King66 @kballard @GoodGuyNick are you guys actually do what is described in https://github.com/Microsoft/vscode/issues/26353#issuecomment-300408442 ? I can reproduce that 👍
@bpasero because the "maximized" setting I used in the past has problem as I described, so I use "inherit" setting now... "inherit" works fine almost always in my case(Win10 1.12.1)
@bpasero
=> does the window restore to where you put it or not?
yes but if I then maximize window and reopen it will revert to the default size and position.
are you guys actually do what is described in #26353 (comment) ? I can reproduce that
no. I make clean install of vscode then open it, the window will be in the default size and position(not maximized and centered). Then I maximize window and reopen vscode expecting window to remember last state but it will again opens in default size and position
If i use "window.newWindowDimensions": "maximized"
or "inherit"
and open second window it is still opens in the default size and position
@King66 let me try to rephrase what you see working and what not:
Is that what you see is going wrong? I am having a hard time to understand your issue. Maybe a screen recording would help.
@GoodGuyNick
yes but if I then maximize window and reopen it will revert to the default size and position.
I tried to reproduce what you are saying but I cannot. Are you on some Windows insiders build maybe?
If i use "window.newWindowDimensions": "maximized" or "inherit" and open second window it is still opens in the default size and position
I can also not reproduce that:
@bpasero Xubuntu 16.04.2 In the past Atom had the same issue with the linux
I see, not reproducible on my Ubuntu 15 at least.
@bpasero still can't reproduce the behavior you posted in this gif...
With no external monitor and using all steps you posted above in https://github.com/Microsoft/vscode/issues/24227#issuecomment-300385069, it still opens in the default size and default position for me. I have 2 MacBook Pro's here and it's happening on both.
macOS Sierra 10.12.4 Visual Studio Code Version 1.12.1 (1.12.1)
@bpasero you're right... For me, the initial window restore the way I left it. And I think "inherit" setting works fine so I am using it.. https://drive.google.com/file/d/0B9sSiOdezYhvaDFpeDZPTVJjaWM/view
@bpasero don't use outdated linux distributions for testing. Use latest LTS releases for any kind of Ubuntu. I've tested on Ubuntu 16.04.2 and Ubuntu GNOME 16.04.2 and there are no issues. I will test on Ubuntu MATE, KDE neon, Linux Mint.
@mattbanks I am trying to decode what your gif is showing:
window.newWindowDimensions
settings and how do you open that second window?@GoodGuyNick thanks, yes my Linux is old I should probably update.
@bpasero Sorry for the confusion - I pasted your gif from above to show the behavior that I'm still not seeing.
Here's what I'm still seeing: http://mattbanks.me/assets/img/random/code-window-issue.gif
expected behavior: window retains last used settings when the app is closed, so that new instances of the app window open in the last used size and position.
caveat: it works as expected if I set "window.newWindowDimensions": "maximized"
. However, I prefer not having it maximized every time, and inherit
would be the ideal setting.
It sounds like this needs to be a new setting, since window.newWindowDimensions
is not intended to work on new instances of the app window (although it did previously work in the past).
@mattbanks can we for this exercise not define the window.newWindowDimensions
setting at all, it should not have an impact on what you are seeing. This setting is only used for any window that opens after the initial window is opened and it seems what you are seeing is that the initial window is not retaining its position?
Can you try to reproduce this from our current insiders build, I pushed a fix in this area that might have an impact: You can give our preview releases a try from: http://code.visualstudio.com/Download#insiders
@bpasero Correct - the issue I'm seeing is that the initial window is only opening in the default positon and not retaining any previously used position or size settings.
Downloading the Insiders build now - will report back shortly!
@bpasero confirmed the Insiders build works as expected! 👍 😄
I tested it with multiple monitors or just on my laptop with no external display connected, resized the window a few times and closed and re-opened the app. The initial window position was properly retained.
@mattbanks great to hear that, but I am still a bit puzzled. My fix (for https://github.com/Microsoft/vscode/issues/26353) was fixing an issue where the position and size of the window was not restored if you close the window (click the x in the title) and then quit the app and then restart. I assume you are pressing Cmd+Q to quit, is that true?
@bpasero Yup, I Cmd+Q to quit the app. I typically Cmd-W all open windows before quitting, if that makes a difference in debugging it.
I just tested the insiders build and I'm seeing really weird behavior. For context, I've removed the window.newWindowDimensions
setting entirely. Here's what I'm seeing:
So basically, the behavior I'm seeing is: If I have no windows open and I open a new one, it always opens in the size and position that the initial window did when I launched the app. And the initial window always opens small and centered, unless I had quit the app with a window already open, at which point it instead restores that window size/position.
This is on macOS 10.12.4 (16E195).
@bpasero I've tested on a latest LTS releases of Ubuntu MATE, KDE neon, Linux Mint Cinnamon and there are no issues. But on a Linux Mint Xfce was the same problem. I've not tested other DE or WM so for now problem only occurs when using vscode with Xfce.
@mattbanks that explains why my fix helps you, thanks.
@GoodGuyNick thanks for testing 👍
@kballard I tried your steps and could not see something odd but that could also be me not following your steps precisely enough. Can you repeat the steps, but this time be very clear what you are doing: e.g. when you quit, do you close a window first and then quit? Here is an example of how detailed I would need your reproduction steps to be:
@bpasero I've tested on LXDE, LXQt and there are no issues.
@bpasero Just found another problem when using "inherit" setting. After minimize a VSCode window, opening another VSCode window will use the default size, I think this is not reasonable..
@bpasero Ok, I reproduced it again. Once again, I left "window.newWindowDimensions"
undefined.
As near as I can tell, VSCode's behavior is: upon quit, if there are any windows open, pick one and record its size/position. Then on the next launch, it reads this size/position, and any time VSCode opens a window that session when there are no existing windows it uses that saved size/position. If I quit VSCode without having any windows open, it doesn't save a size/position, and therefore new windows in the next session use the "default" size/position.
This is, frankly, pretty weird.
@kballard is that with stable or with the insiders build?
@King66 good catch, I have extracted https://github.com/Microsoft/vscode/issues/26586
@bpasero That was with the Insiders build.
After updating to v1.11.0 (and 1.11.1), setting
"window.newWindowDimensions": "inherit"
no longer works. Every new window opens at the default position and size.Steps to Reproduce:
"window.newWindowDimensions": "inherit"
is set in settings.json