[PR #9509] Teach OpenConsole.psm1 to support multiple terminal checkouts #27615

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

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

State: closed
Merged: Yes


OpenConsole.psm1 cached its root directory on import, which made it very
difficult to move into another Terminal clone and do things (like code
formatting).

By resolving the root directory again per-cmdlet, we gain the ability
to...

cd terminal
import-module ./tools/openconsole.psm1
cd ../terminal-2
invoke-codeformat

... and have it format the correct directory (terminal-2) instead of the
incorrect one (terminal).

This does unfortunately break the openconsole cmdlets inside dep/wil
and dep/gsl
because they are separate git repositories. This is taken
as an acceptable cost.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/9509 **State:** closed **Merged:** Yes --- OpenConsole.psm1 cached its root directory on import, which made it very difficult to move into another Terminal clone and _do things_ (like code formatting). By resolving the root directory again per-cmdlet, we gain the ability to... ```powershell cd terminal import-module ./tools/openconsole.psm1 cd ../terminal-2 invoke-codeformat ``` ... and have it format the correct directory (terminal-2) instead of the incorrect one (terminal). This does unfortunately break the openconsole cmdlets _inside dep/wil and dep/gsl_ because they are separate git repositories. This is taken as an acceptable cost.
claunia added the pull-request label 2026-01-31 09:23:02 +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#27615