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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9509
Author: @DHowett
Created: 3/15/2021
Status: ✅ Merged
Merged: 3/17/2021
Merged by: @DHowett

Base: main ← Head: dev/duhowett/makethemoduleslightlybetter


📝 Commits (1)

  • eca931a Teach OpenConsole.psm1 to support multiple terminal checkouts

📊 Changes

1 file changed (+31 additions, -16 deletions)

View changed files

📝 tools/OpenConsole.psm1 (+31 -16)

📄 Description

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.


🔄 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/9509 **Author:** [@DHowett](https://github.com/DHowett) **Created:** 3/15/2021 **Status:** ✅ Merged **Merged:** 3/17/2021 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `dev/duhowett/makethemoduleslightlybetter` --- ### 📝 Commits (1) - [`eca931a`](https://github.com/microsoft/terminal/commit/eca931a93126bec6a672a30a42763e85caf57733) Teach OpenConsole.psm1 to support multiple terminal checkouts ### 📊 Changes **1 file changed** (+31 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `tools/OpenConsole.psm1` (+31 -16) </details> ### 📄 Description 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. --- <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:23:00 +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#27610