[PR #5671] Correct position on startup when window is out of screen #26413

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

Original Pull Request: https://github.com/microsoft/terminal/pull/5671

State: closed
Merged: No


Summary of the Pull Request

If the terminal window appears to be off-screen at startup or appears to be partially behind the task bar, reset its position to the top left corner of the screen. Manually tested by giving

References

#4681

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

This will reset the window to top-left because the window is partially behind the taskbar:
test1

This will reset the window to top-left because the left side of the window is off the screen:
test2

This will reset the window to top-left because the window is partially off the screen:
test3

For multi-monitor:

Note that this will also reset the window to top-left because the window can fit in a single screen but the window is outside of the screen's work area:
test4

This will reset the window to top-left because the window can fit in a single screen but the window is outside of the screen's work area:
test5

This will reset the window to top-left because the window is partially off the screen:
test6

Note that this will NOT reset the window position to top-left because the window is entirely visible.
test7

**Original Pull Request:** https://github.com/microsoft/terminal/pull/5671 **State:** closed **Merged:** No --- <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request If the terminal window appears to be off-screen at startup or appears to be partially behind the task bar, reset its position to the top left corner of the screen. Manually tested by giving <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References #4681 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #3187 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #3187 <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed This will reset the window to top-left because the window is partially behind the taskbar: <img width="1279" alt="test1" src="https://user-images.githubusercontent.com/14287111/80723098-2eb91900-8ace-11ea-8d63-1d38b7c5b977.png"> This will reset the window to top-left because the left side of the window is off the screen: <img width="1279" alt="test2" src="https://user-images.githubusercontent.com/14287111/80723106-34166380-8ace-11ea-9f96-7e9fe78d2b23.png"> This will reset the window to top-left because the window is partially off the screen: <img width="1279" alt="test3" src="https://user-images.githubusercontent.com/14287111/80723121-37a9ea80-8ace-11ea-916a-44387e5dbb3b.png"> For multi-monitor: Note that this will also reset the window to top-left because the window can fit in a single screen but the window is outside of the screen's work area: <img width="2240" alt="test4" src="https://user-images.githubusercontent.com/14287111/80723130-3a0c4480-8ace-11ea-8f0d-504264e3d17c.png"> This will reset the window to top-left because the window can fit in a single screen but the window is outside of the screen's work area: <img width="1280" alt="test5" src="https://user-images.githubusercontent.com/14287111/80723149-40022580-8ace-11ea-8d86-b8b0d266b10e.png"> This will reset the window to top-left because the window is partially off the screen: <img width="2240" alt="test6" src="https://user-images.githubusercontent.com/14287111/80723159-4395ac80-8ace-11ea-997f-1e5a6af35f91.png"> Note that this will NOT reset the window position to top-left because the window is entirely visible. <img width="2240" alt="test7" src="https://user-images.githubusercontent.com/14287111/80723165-45f80680-8ace-11ea-9250-f1b74d671ebf.png">
claunia added the pull-request label 2026-01-31 09:15:54 +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#26413