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

Remember last window position and size #5858

Closed
mataski opened this issue May 12, 2020 · 8 comments
Closed

Remember last window position and size #5858

mataski opened this issue May 12, 2020 · 8 comments
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@mataski
Copy link

mataski commented May 12, 2020

Description of the new feature/enhancement

You have to drag it and reposition and resize every time on launch.

@mataski mataski added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label May 12, 2020
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 12, 2020
@zadjii-msft
Copy link
Member

Thanks for the suggestion! This is actually already being tracked by another issue on our repo - please refer to #766 for more discussion.

/dup #766

Also, if you like using the same window position every single time, might I interest you in the initialPosition setting? You can use that to position the window, and the initialCols/initialRows setting to control the launch size.

Property Necessity Type Default Description
initialCols Required Integer 120 The number of columns displayed in the window upon first load.
initialPosition Optional String "," The position of the top left corner of the window upon first load. On a system with multiple displays, these coordinates are relative to the top left of the primary display. If launchMode is set to "maximized", the window will be maximized on the monitor specified by those coordinates.
initialRows Required Integer 30 The number of rows displayed in the window upon first load.
launchMode Optional String default Defines whether the Terminal will launch as maximized or not. Possible values: "default", "maximized"

@ghost
Copy link

ghost commented May 12, 2020

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed May 12, 2020
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 12, 2020
@ghost
Copy link

ghost commented May 18, 2021

@zadjii-msft I don't see how this is a duplicate of 766. this issue describes wanting to have the window frame restored to it's last known position and size on launch, where 766 describes wanting to have the terminal app restore previously open profile tabs on launch...

I'm still only testing MS Terminal, using Hyper as my primary, mostly just because the terminal window opens in unexpected places, which (after using a keyboard shortcut to launch it) I still need to flip to my mouse, move the window, then flip back to my keyboard to continue.

This may be a trivial UI point, but it's one crazy UX killer...

@zadjii-msft
Copy link
Member

From #766

To clarify:

  • Enable Terminal to persist / restore instance settings #766 (This issue) is tracking restoring the relative window state across terminal launches. This includes (but is not limited to) window positions, the open tab/pane structure, and what profiles were in those tab/panes. It is not tracking restoring buffer state.
  • Restore previously closed session's state (Buffer contents) #961 is specifically related to trying to restore the buffer content of these tabs/panes. This is substantially harder than just restoring the window state, because the buffer has quite a bit more state in it. It is not tracking connection state (commandline history, environment variables, open processes)
  • Feature Request - Restore closed tab #960 is about just "restoring previously opened tabs/panes". This is like when you close a tab in a browser, then hit Ctrl+shift+t to just pop it back into existence. This does not include across reboots - it mainly deals with tab/panes closed in the current instance.
  • There's not an issue tracking restoring connection/shell/process state, because that's generally impossible. (case in point: #961 (comment), et. al in that thread.)
  • Restore window position when monitor topology changes #9188 is "restoring the window state while it is running, but after an external monitor is disconnected and re-connected?"

(emp. added)

initialPosition can be used if you're always wanting the window in the same position.

alt+space, m, arrow keys can be used to move the window with the keyboard (if you really hate using the mouse).

@ghost
Copy link

ghost commented May 18, 2021

Ah, it seems that this goes much deeper than my issue search revealed earlier.. Apologies for jumping to conclusions, but also thank you for the clarification.

I do still have some strange behaviour regarding the window positioning that feel like issues to be fixed, so I'll go digging through other issue logs and comments later when I have a bit more time. 👍🏼

@iVapor
Copy link

iVapor commented Apr 25, 2023

Search a lot. Just add initialPosition in your settings.json.
"initialPosition": "2400,500", // x,y

@isimmons
Copy link

So if all I want is to remember size and position like ever other application but not restore old sessions (tabs, CWD, history, etc.) I just do the following?

Go into settings.json, add the missing initialPosition setting, tinker and adjust multiple times, restarting terminal until you finally get the position right. Now change initialCol and initialRow size because top/left position is correct but bottom/left is off the screen. Now since changing initialCol and initialRow actually affected the top/left position instead of expected bottom/right, go back and tinker/adjust the position multiple times again until it is correct. Possibly need to readjust the col and row again. Keep repeating the whole process until the window size and position is where you want it. Then repeat on another PC with a different screen size and resolution. Make a backup copy of settings.json (for each PC) so you don't have to go through this process again.

Is that right?

Sounds easy enough

@DHowett
Copy link
Member

DHowett commented Jul 21, 2023

Yup, that's right!

@microsoft microsoft locked as resolved and limited conversation to collaborators Jul 21, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

5 participants