[PR #14222] [MERGED] Respect the "/max" parameter when starting console apps with defterm enabled #30007

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14222
Author: @PankajBhojwani
Created: 10/14/2022
Status: Merged
Merged: 10/26/2022
Merged by: @undefined

Base: mainHead: dev/pabhoj/defterm_max


📝 Commits (5)

📊 Changes

5 files changed (+27 additions, -0 deletions)

View changed files

📝 src/cascadia/TerminalApp/TerminalPage.cpp (+16 -0)
📝 src/cascadia/TerminalConnection/ConptyConnection.cpp (+6 -0)
📝 src/cascadia/TerminalConnection/ConptyConnection.h (+2 -0)
📝 src/cascadia/TerminalConnection/ConptyConnection.idl (+1 -0)
📝 src/host/srvinit.cpp (+2 -0)

📄 Description

Summary of the Pull Request

  • Pipe the ShowWindow value through to ConptyConnection
  • When TerminalPage receives the new connection, it checks the ShowWindow value and maximizes IF there were no other pre-existing tabs (in glomming mode, we don't want to maximize sessions that did not ask for it)

References

#12154

PR Checklist

  • Closes #xxx
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Documentation updated. If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated.
  • 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: #xxx

Detailed Description of the Pull Request / Additional comments

This is just a temporary solution until we change our defterm handoff process. Because of the way the process currently works, we have no way of knowing that the connection has requested the window to be maximized until after we have already started a terminal session. This means that we have to manually maximize the window upon receiving the connection, instead of having the session start maximized, as it probably should.

Validation Steps Performed

start /max python with defterm enabled opens up python in a maximized WT window


🔄 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/14222 **Author:** [@PankajBhojwani](https://github.com/PankajBhojwani) **Created:** 10/14/2022 **Status:** ✅ Merged **Merged:** 10/26/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/pabhoj/defterm_max` --- ### 📝 Commits (5) - [`425dd91`](https://github.com/microsoft/terminal/commit/425dd914b8f49cb3a8a983411d247263de1cb751) initial - [`3955c0c`](https://github.com/microsoft/terminal/commit/3955c0c6b8a5bd69763d56f052b1f10a7c652138) check no other tabs - [`3f8739a`](https://github.com/microsoft/terminal/commit/3f8739ad6cffd07e2896d82328b8a8b3f379f918) terminal, not console - [`09fb0b8`](https://github.com/microsoft/terminal/commit/09fb0b8e63cbb4465c25ef993137873bbab4c11c) noexcept - [`a8e845d`](https://github.com/microsoft/terminal/commit/a8e845d495599714cb13a6bb102f55f8eb010bdb) use SW_SHOWMAXIMIZED ### 📊 Changes **5 files changed** (+27 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+16 -0) 📝 `src/cascadia/TerminalConnection/ConptyConnection.cpp` (+6 -0) 📝 `src/cascadia/TerminalConnection/ConptyConnection.h` (+2 -0) 📝 `src/cascadia/TerminalConnection/ConptyConnection.idl` (+1 -0) 📝 `src/host/srvinit.cpp` (+2 -0) </details> ### 📄 Description ## Summary of the Pull Request - Pipe the `ShowWindow` value through to `ConptyConnection` - When `TerminalPage` receives the new connection, it checks the `ShowWindow` value and maximizes *IF* there were no other pre-existing tabs (in glomming mode, we don't want to maximize sessions that did not ask for it) ## References #12154 ## PR Checklist * [ ] Closes #xxx * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [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: #xxx ## Detailed Description of the Pull Request / Additional comments This is just a temporary solution until we change our defterm handoff process. Because of the way the process currently works, we have no way of knowing that the connection has requested the window to be maximized until after we have already started a terminal session. This means that we have to manually maximize the window upon receiving the connection, instead of having the session _start_ maximized, as it probably should. ## Validation Steps Performed `start /max python` with defterm enabled opens up python in a maximized WT window --- <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:38:08 +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#30007