[PR #12102] [MERGED] Fix //wsl$ paths not working in MangleStartingDirectoryForWSL #28848

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12102
Author: @zadjii-msft
Created: 1/6/2022
Status: ✅ Merged
Merged: 1/11/2022
Merged by: @undefined

Base: main ← Head: dev/migrie/b/11994-wsl-mangling-but-for-real


📝 Commits (7)

  • 1a97262 Move this function to types/ so we can write tests for it
  • 57ffae8 more mangling
  • a33c84b more tests
  • 453bf37 add support for .localhost too
  • c178630 spel
  • 031dc3c Merge remote-tracking branch 'origin/main' into dev/migrie/b/11994-wsl-mangling-but-for-real
  • 49a09dc whyd this ever get allowed? I mean, I feel like its a word but if you want to complain, then dont let me commit....

📊 Changes

5 files changed (+239 additions, -67 deletions)

View changed files

📝 .github/actions/spelling/expect/expect.txt (+1 -0)
📝 src/cascadia/TerminalConnection/ConptyConnection.cpp (+1 -67)
📝 src/types/inc/utils.hpp (+9 -0)
📝 src/types/ut_types/UtilsTests.cpp (+144 -0)
📝 src/types/utils.cpp (+84 -0)

📄 Description

This PR does two things, which are best viewed as atomic commits:

  • e64ae7d: Move the MangleStartingDirectoryForWSL to types/utils. It doesn't really make sense in types, since it's only really being used in a single place in TerminalConnection. However, TerminalConnection doesn't have tests, and types does. So this commit move the function there, and adds tests from #9223 to the types tests.
  • 42036c5: This actually fixes the bug in #11994. Unfortunately, wsl --cd will try to treat paths starting with //wsl$ as a linux-relative path, when the user almost certainly wanted a windows-relative one. So we'll mangle that back into a path that looks like \\wsl$\foo\bar.
  • closes The way Settings works sucks! You should give us a a menu to select color and opacity settings! (#11994)
  • I work here
  • tests added 🎉

🔄 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/12102 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 1/6/2022 **Status:** ✅ Merged **Merged:** 1/11/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/b/11994-wsl-mangling-but-for-real` --- ### 📝 Commits (7) - [`1a97262`](https://github.com/microsoft/terminal/commit/1a97262d40ab1676735edb2b7fcdb6b25159244f) Move this function to types/ so we can write tests for it - [`57ffae8`](https://github.com/microsoft/terminal/commit/57ffae8f377ddf77be234457e97dd593d021bdfa) more mangling - [`a33c84b`](https://github.com/microsoft/terminal/commit/a33c84b9f8c1b9843c68773acfff2312a2062f85) more tests - [`453bf37`](https://github.com/microsoft/terminal/commit/453bf37496cc31204da9fed3b5c2aab9a6c454c0) add support for .localhost too - [`c178630`](https://github.com/microsoft/terminal/commit/c1786304925620151e92ce7b111bc4c85fed9a18) spel - [`031dc3c`](https://github.com/microsoft/terminal/commit/031dc3c0fb47093ef12a0281adc6e6fdd0311eb9) Merge remote-tracking branch 'origin/main' into dev/migrie/b/11994-wsl-mangling-but-for-real - [`49a09dc`](https://github.com/microsoft/terminal/commit/49a09dca5ec9e7637c9ed2c690a23d110905b0b4) whyd this ever get allowed? I mean, I feel like its a word but if you want to complain, then dont let me commit.... ### 📊 Changes **5 files changed** (+239 additions, -67 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/expect/expect.txt` (+1 -0) 📝 `src/cascadia/TerminalConnection/ConptyConnection.cpp` (+1 -67) 📝 `src/types/inc/utils.hpp` (+9 -0) 📝 `src/types/ut_types/UtilsTests.cpp` (+144 -0) 📝 `src/types/utils.cpp` (+84 -0) </details> ### 📄 Description This PR does two things, which are best viewed as atomic commits: * e64ae7d: Move the `MangleStartingDirectoryForWSL` to `types/utils`. It doesn't _really_ make sense in `types`, since it's only really being used in a single place in TerminalConnection. However, TerminalConnection doesn't have tests, and types does. So this commit move the function there, and adds tests from #9223 to the types tests. * 42036c5: This actually fixes the bug in #11994. Unfortunately, `wsl --cd` will try to treat paths starting with `//wsl$` as a linux-relative path, when the user almost certainly wanted a windows-relative one. So we'll mangle that back into a path that looks like `\\wsl$\foo\bar`. * [x] closes #11994 * [x] I work here * [x] tests added 🎉 --- <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:31:11 +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#28848