26

On opening Windows Terminal (Preview), part of the window is below the taskbar. When I move the application window to a desired position on screen and re-open the application, it is not at the previous position, which I had set by dragging the window.

In the profile.json settings file, there is no option to set the default window location.

How do keep the window position from previous session, as I don't want to drag the window every time I open the application?

2 Answers2

43

Restoring the previous position is not possible yet, but as of https://github.com/microsoft/terminal/releases/tag/v0.6.2951.0 you can set an initial position for new windows:

    "initialCols": 120,
    "initialRows": 60,
    "initialPosition": "2400,500", // x,y

Also see https://devblogs.microsoft.com/commandline/windows-terminal-preview-1910-release/.

voglerr
  • 883
  • 2
  • 11
  • 18
  • 1
    ugh, this is great, but also so ungreat. for me, an option along the lines of CSS with optional combinations of width, height, and margins would be much easier to set up and more portable when my monitor resolution changes. – orion elenzil May 27 '21 at 17:17
5

If you just want to center the terminal then add the following attribute to your terminal's settings.json:

"centerOnLaunch": true,

refer to microsoft docs: center on launch

If you want specific position then add this code instead:

"initialCols": 120,
"initialRows": 60,
"initialPosition": "2400,500", // x,y
LazerDance
  • 177
  • 1
  • 8
  • To open the settings JSON file, launch the terminal, click the arrow next to the open tab, hold `SHIFT` and click `Settings`. – Mahozad Jan 27 '23 at 18:50