Be able to set an initial position for the terminal #1399

Closed
opened 2026-01-30 22:25:05 +00:00 by claunia · 13 comments
Owner

Originally created by @patriksvensson on GitHub (May 28, 2019).

Environment

Windows build number: Microsoft Windows [Version 10.0.18362.86]
Windows Terminal version (if applicable): commit bbbd3e0323a82548416f40ddba

Steps to reproduce

  1. Start Windows Terminal
  2. Move the Windows Terminal window
  3. Close Windows Terminal
  4. Start Windows Terminal

Expected behavior

Window position is restored to were it was in step 3 above.

Actual behavior

Window is opened at a default location.

Originally created by @patriksvensson on GitHub (May 28, 2019). # Environment ```none Windows build number: Microsoft Windows [Version 10.0.18362.86] Windows Terminal version (if applicable): commit bbbd3e0323a82548416f40ddba ``` # Steps to reproduce 1. Start Windows Terminal 2. Move the Windows Terminal window 3. Close Windows Terminal 4. Start Windows Terminal # Expected behavior Window position is restored to were it was in step 3 above. # Actual behavior Window is opened at a default location.
claunia added the Resolution-Fix-CommittedArea-SettingsIssue-TaskProduct-Terminal labels 2026-01-30 22:25:05 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (May 28, 2019):

What if you have more than one window?

@DHowett-MSFT commented on GitHub (May 28, 2019): What if you have more than one window?
Author
Owner

@patriksvensson commented on GitHub (May 28, 2019):

@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 initialRows and initialCols)

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).

@patriksvensson commented on GitHub (May 28, 2019): @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 `initialRows` and `initialCols`) 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).
Author
Owner

@zadjii-msft commented on GitHub (May 29, 2019):

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:

I would want a way of setting the default window position somehow (like I can with the old fashion terminal).

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.

@zadjii-msft commented on GitHub (May 29, 2019): 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: > I would want a way of setting the default window position somehow (like I can with the old fashion terminal). 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.
Author
Owner

@UweKeim commented on GitHub (Jun 22, 2019):

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 windowRestoreMode being an enum of values like:

  • none — Do nothing, let Windows place automatically.
  • lastPositionAndSize — Restore pixel-perfect both in position and size, no matter whether docked before (just like I described in #1420)
  • Possibly more modes…
@UweKeim commented on GitHub (Jun 22, 2019): 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: ```json { "windowRestoreMode": "lastPositionAndSize" } ``` With `windowRestoreMode` being an enum of values like: - `none` — Do nothing, let Windows place automatically. - `lastPositionAndSize` — Restore pixel-perfect both in position and size, no matter whether docked before (just like I described in #1420) - Possibly more modes…
Author
Owner

@lllopo commented on GitHub (Jun 23, 2019):

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 windowRestoreMode being an enum of values like:

  • none — Do nothing, let Windows place automatically.
  • lastPositionAndSize — Restore pixel-perfect both in position and size, no matter whether docked before (just like I described in #1420)
  • Possibly more modes…

"Possibly more modes" should also include a predefined position on screen in pixels, imho.

@lllopo commented on GitHub (Jun 23, 2019): > 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: > > ```json > { > "windowRestoreMode": "lastPositionAndSize" > } > ``` > > With `windowRestoreMode` being an enum of values like: > > * `none` — Do nothing, let Windows place automatically. > * `lastPositionAndSize` — Restore pixel-perfect both in position and size, no matter whether docked before (just like I described in #1420) > * Possibly more modes… "Possibly more modes" should also include a predefined position on screen in pixels, imho.
Author
Owner

@UweKeim commented on GitHub (Jun 23, 2019):

Sounds very good, @lllopo.

For your defindedPositionAndSize mode, one could enhance this like e.g.:

{
    "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 windowPos array, the second instance of Terminal uses the second object in the array, and so on.

For following instances with no representation in the windowPos array, an entry with "isDefault": true is searched, or if none is found, the first entry is being used.

@UweKeim commented on GitHub (Jun 23, 2019): Sounds very good, @lllopo. For your `defindedPositionAndSize` mode, one could enhance this like e.g.: ```json { "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: ```json { "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 `windowPos` array, the second instance of Terminal uses the second object in the array, and so on. For following instances with no representation in the `windowPos` array, an entry with `"isDefault": true` is searched, or if none is found, the first entry is being used.
Author
Owner

@UweKeim commented on GitHub (Sep 27, 2019):

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.

@UweKeim commented on GitHub (Sep 27, 2019): 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.
Author
Owner

@ghost commented on GitHub (Oct 23, 2019):

:tada:This issue was addressed in #2817, which has now been successfully released as Windows Terminal Preview v0.6.2951.0.🎉

Handy links:

@ghost commented on GitHub (Oct 23, 2019): :tada:This issue was addressed in #2817, which has now been successfully released as `Windows Terminal Preview v0.6.2951.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v0.6.2951.0) * [Store Download](https://www.microsoft.com/store/apps/9n0dx20hk701?cid=storebadge&ocid=badge)
Author
Owner

@Seefer commented on GitHub (Aug 6, 2020):

What if you have more than one window?

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.

@Seefer commented on GitHub (Aug 6, 2020): > What if you have more than one window? 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.
Author
Owner

@escalonn commented on GitHub (Nov 4, 2021):

this is still an issue in the present released version.

@escalonn commented on GitHub (Nov 4, 2021): this is still an issue in the present released version.
Author
Owner

@zadjii-msft commented on GitHub (Nov 4, 2021):

@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 settings.json, your Terminal version, etc.

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.

@zadjii-msft commented on GitHub (Nov 4, 2021): @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 `settings.json`, your Terminal version, etc. 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.
Author
Owner

@UweKeim commented on GitHub (Nov 4, 2021):

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.

@UweKeim commented on GitHub (Nov 4, 2021): 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](https://www.displayfusion.com) and created [a trigger](https://www.displayfusion.com/Features/Triggers/) therein to position the Terminal window correctly after it start.
Author
Owner

@patriksvensson commented on GitHub (Nov 4, 2021):

@zadjii-msft I think you should lock this issue.

@patriksvensson commented on GitHub (Nov 4, 2021): @zadjii-msft I think you should lock this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1399