[PR #9036] [MERGED] Add centerOnLaunch setting #27391

Open
opened 2026-01-31 09:21:42 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9036
Author: @zadjii-msft
Created: 2/4/2021
Status: Merged
Merged: 2/19/2021
Merged by: @undefined

Base: mainHead: dev/migrie/f/finish-center-on-launch


📝 Commits (7)

  • d8ca6bc Add CentreOnLaunch property
  • 5f27ad5 code format
  • 6a3a852 correct spelling
  • 7738d4e Merge remote-tracking branch 'origin/main' into dev/migrie/f/finish-center-on-launch
  • c79b4c8 this seems to work
  • 7c0042d some cleanup
  • c3b10e7 update schema

📊 Changes

8 files changed (+47 additions, -2 deletions)

View changed files

📝 doc/cascadia/profiles.schema.json (+5 -0)
📝 src/cascadia/TerminalApp/AppLogic.cpp (+10 -0)
📝 src/cascadia/TerminalApp/AppLogic.h (+1 -0)
📝 src/cascadia/TerminalApp/AppLogic.idl (+1 -0)
📝 src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp (+5 -0)
📝 src/cascadia/TerminalSettingsModel/GlobalAppSettings.h (+1 -0)
📝 src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl (+4 -0)
📝 src/cascadia/WindowsTerminal/AppHost.cpp (+20 -2)

📄 Description

This PR is a resurrection of #8414. @Hegunumo has apparently deleted
their account, but the contribution was still valuable. I'm just here to
get it across the finish line.

This PR adds new global setting centerOnLaunch. When set to true,
the Terminal window will be centered on the display it opens on.

So the interactions are like:

  • initialPos: x,y, centered: true, launchMode: default
    center on the monitor that x,y is on

  • initialPos: x,y, centered: true, launchMode: maximized
    maximized on the monitor that x,y is on (centered adds nothing)

  • initialPos: <omitted>, centered: true, launchMode: default
    center on the default monitor

  • initialPos: <omitted>, centered: true, launchMode: focus
    center, focus mode on the default monitor

  • initialPos: <omitted>, centered: true, launchMode: maximized
    maximized on the default monitor (centered adds nothing)

Validation Steps Performed

I've played with it on multiple different monitors, and it seems to work
on all of them.

Closes #8414 (original PR)
Closes #7722

Co-authored-by: Kiminori Kaburagi yukawa_hidenori@icloud.com


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/9036 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 2/4/2021 **Status:** ✅ Merged **Merged:** 2/19/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/f/finish-center-on-launch` --- ### 📝 Commits (7) - [`d8ca6bc`](https://github.com/microsoft/terminal/commit/d8ca6bc08a7d505877d6af320c75ba7d77cfa897) Add CentreOnLaunch property - [`5f27ad5`](https://github.com/microsoft/terminal/commit/5f27ad5491f55126a1854a5f3f3e44aafdd51b68) code format - [`6a3a852`](https://github.com/microsoft/terminal/commit/6a3a852e8c937da5ae3dfc2e10455bece9f24104) correct spelling - [`7738d4e`](https://github.com/microsoft/terminal/commit/7738d4ec7cbc2d5fb9272037ebb90be4e7282e20) Merge remote-tracking branch 'origin/main' into dev/migrie/f/finish-center-on-launch - [`c79b4c8`](https://github.com/microsoft/terminal/commit/c79b4c8d0570579691352e91a3776df666caba76) this seems to work - [`7c0042d`](https://github.com/microsoft/terminal/commit/7c0042da3e5ebd88c33c628f1c066f6179c34378) some cleanup - [`c3b10e7`](https://github.com/microsoft/terminal/commit/c3b10e71be9ea63af6b451300b1dee6ce98451e3) update schema ### 📊 Changes **8 files changed** (+47 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `doc/cascadia/profiles.schema.json` (+5 -0) 📝 `src/cascadia/TerminalApp/AppLogic.cpp` (+10 -0) 📝 `src/cascadia/TerminalApp/AppLogic.h` (+1 -0) 📝 `src/cascadia/TerminalApp/AppLogic.idl` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp` (+5 -0) 📝 `src/cascadia/TerminalSettingsModel/GlobalAppSettings.h` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl` (+4 -0) 📝 `src/cascadia/WindowsTerminal/AppHost.cpp` (+20 -2) </details> ### 📄 Description This PR is a resurrection of #8414. @Hegunumo has apparently deleted their account, but the contribution was still valuable. I'm just here to get it across the finish line. This PR adds new global setting `centerOnLaunch`. When set to `true`, the Terminal window will be centered on the display it opens on. So the interactions are like: * `initialPos: x,y`, `centered: true`, `launchMode: default` center on the monitor that x,y is on * `initialPos: x,y`, `centered: true`, `launchMode: maximized` maximized on the monitor that x,y is on (centered adds nothing) * `initialPos: <omitted>`, `centered: true`, `launchMode: default` center on the default monitor * `initialPos: <omitted>`, `centered: true`, `launchMode: focus` center, focus mode on the default monitor * `initialPos: <omitted>`, `centered: true`, `launchMode: maximized` maximized on the default monitor (centered adds nothing) ## Validation Steps Performed I've played with it on multiple different monitors, and it seems to work on all of them. Closes #8414 (original PR) Closes #7722 Co-authored-by: Kiminori Kaburagi <yukawa_hidenori@icloud.com> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:21:42 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27391