-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Be able to set an initial position for the terminal #1043
Comments
What if you have more than one window? |
@DHowett-MSFT Good question and I realize my expectations what somewhat flawed. Currently the Windows Terminal window is opened so that half the terminal is outside of my screen bounds (I've changed the When I think about it, I would want a way of setting the default window position somehow (like I can with the old fashion terminal). |
There's already #766, which deals with restoring general state from the previous session. I'd say much of this issue fits under that umbrella, save for:
Shockingly, I don't think we have an issue tracking that particular feature request quite yet. This is now the thread tracking that feature request. |
Personally, I prefer even having multiple instances being restored to the very same pixel position and size rather than stacking them pseudo-randomly over my desktop. Tastes are different, so why not add an option like: {
"windowRestoreMode": "lastPositionAndSize"
} With
|
"Possibly more modes" should also include a predefined position on screen in pixels, imho. |
Sounds very good, @lllopo. For your {
"windowRestoreMode": "definedPositionAndSize",
"windowPos":
{
"x": 100,
"y": 120,
"width": 400,
"height": 800
}
} One could even enhance this for multiple intances of Terminal to each use another set of positions/sizes like: {
"windowRestoreMode": "definedPositionAndSize",
"windowPos":
[
{
"isDefault": true,
"x": 100,
"y": 120,
"width": 400,
"height": 800
},
{
"x": 500,
"y": 120,
"width": 400,
"height": 800
},
{
"x": 900,
"y": 120,
"width": 400,
"height": 800
}
]
} I.e. the first instance use the first object of position and size in the For following instances with no representation in the |
Just one more discovery: Visual Studio Code starts the first instance pixel-perfect as it was closed before. When starting a second instance, it starts it as some default position and size. Not as advanced as my suggestion, but way better than Terminal doing now. |
This PR includes the code changes that enable users to set an initial position (top left corner) and launch maximized. There are some corner cases: 1. Multiple monitors. The user should be able to set the initial position to any monitors attached. For the monitors on the left side of the major monitor, the initial position values are negative. 2. If the initial position is larger than the screen resolution and the window is off-screen, the current solution is to check if the top left corner of the window intersect with any monitors. If it is not, we set the initial position to the top left corner of the nearest monitor. 3. If the user wants to launch maximized and provides an initial position, we launch the maximized window on the monitor where the position is located. # Testing To test: 1. Check-out this branch and build on VS2019 2. Launch Terminal, and open Settings. Then close the terminal. 3. Add the following setting into Json settings file as part of "globals", just after "initialRows": "initialPosition": "1000, 1000", "launchMode": "default" My test data: I have already tested with the following variables: 1. showTabsInTitlebar true or false 2. The initial position of the top left corner of the window 3. Whether to launch maximized 4. The DPI of the monitor Test data combination: Non-client island window (showTabsInTitlebar true) 1. Three monitors with the same DPI (100%), left, middle and right, with the middle one as the primary, resolution: 1980 * 1200, 1920 * 1200, 1920 * 1080 launchMode: default In-Screen test: (0, 0), (1000, 500), (2000, 300), (-1000, 400), (-100, 200), (-2000, 100), (0, 1119) out-of-screen: (200, -200): initialize to (0, 0) (200, 1500): initialize to (0, 0) (2000, -200): initialize to (1920, 0) (2500, 2000): initialize to (1920, 0) (4000 100): initialize to (1920, 0) (-1000, -100): initialize to (-1920, 0) (-3000, 100): initialize to (-1920, 0) (10000, -10000): initialize to (1920, 0) (-10000, 10000): initialize to (-1920, 0) (0, -10000): initialize to (0, 0) (0, -1): initialize to (0, 0) (0, 1200): initialize to (0, 0) launch mode: maximize (100, 100) (-1000, 100): On the left monitor (0, -2000): On the primary monitor (10000, 10000): On the primary monitor 2. Left monitor 200% DPI, primary monitor 100% DPI In screen: (-1900, 100), (-3000, 100), (-1000, 100) our-of-screen: (-8000, 100): initialize at (-1920, 0) launch Maximized: (-100, 100): launch maximized on the left monitor correctly 3. Left monitor 100% DPI, primary monitor 200% DPI In-screen: (-1900, 100), (300, 100), (-800, 100), (-200, 100) out-of-screen: (-3000, 100): initialize at (-1920, 0) launch maximized: (100, 100), (-1000, 100) For client island window, the test data is the same as above. Issues: 1. If we set the initial position on the monitor with a different DPI as the primary monitor, and the window "lays" across two monitors, then the window still renders as it is on the primary monitor. The size of the window is correct. Closes #1043
🎉This issue was addressed in #2817, which has now been successfully released as Handy links: |
More than one window is great in multiple monitor arrangements and I'd still like to have control over where they open and the their size on each display. For multiple terminals on one display I'd prefer to have a tab feature in one window or use WTs splitPane function rather than separate windows. |
this is still an issue in the present released version. |
@escalonn This feature was merged two years ago, can you file a new issue to track whatever you're seeing? Please make sure to include your There's also #766 which merged into 1.12, which will restore the window positions automatically, which is part of what this thread was discussion originally. |
For me, it is still not working pixel-perfect, too, when being docked to either side of the screen. I gave up, bought DisplayFusion Pro and created a trigger therein to position the Terminal window correctly after it start. |
@zadjii-msft I think you should lock this issue. |
Environment
Steps to reproduce
Expected behavior
Window position is restored to were it was in step 3 above.
Actual behavior
Window is opened at a default location.
The text was updated successfully, but these errors were encountered: