Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: No (WSL depends on some dependencies) <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.88.0 OS Version: Windows 11 23H2 Steps to Reproduce: In a WSL shell run . does not return until the editor tab is closed again. This is no longer intended behaviour since was solved. In PowerShell on the Windows host, the command does work as intended, when running .
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected. If things still don't seem right, please ensure you're on version of Insiders (today's or later - you can use in the command palette to check), and leave a comment letting us know what isn't working as expected. Happy Coding!
/verified with VSCode 1.89.0 stable

Discussion:
import { createWaitMarkerFileSync } from 'vs/platform/environment/node/wait'; import { PipeCommand } from 'vs/workbench/api/node/extHostCLIServer'; import { hasStdinWithoutTty, getStdinFilePath, readFromStdin } from 'vs/platform/environment/node/stdin'; <ins> import { DeferredPromise } from 'vs/base/common/async'; </ins> /* * Implements a standalone CLI app that opens VS Code from a remote terminal.

parsedArgs['_'] = []; <ins> let readFromStdinPromise: Promise<void> | undefined; </ins> if (hasReadStdinArg && hasStdinWithoutTty()) { try { let stdinFilePath = cliStdInFilePath; if (!stdinFilePath) { stdinFilePath = getStdinFilePath(); <del> await readFromStdin(stdinFilePath, verbose); // throws error if file can not be written </del> <ins> const readFromStdinDone = new DeferredPromise<void>(); await readFromStdin(stdinFilePath, verbose, () => readFromStdinDone.complete()); // throws error if file can not be written if (!parsedArgs.wait) { // if `--wait` is not provided, we keep this process alive // for at least as long as the stdin stream is open to // ensure that we read all the data. readFromStdinPromise = readFromStdinDone.p; } </ins> } // Make sure to open tmp file translatePath(stdinFilePath, mapFileUri, folderURIs, fileURIs); <del> // Enable --wait to get all data and ignore adding this to history parsedArgs.wait = true; </del> <ins> // Ignore adding this to history </ins> parsedArgs['skip-add-to-recently-opened'] = true; console.log(`Reading from stdin via: ${stdinFilePath}`); } catch (e) { console.log(`Failed to create file to read via stdin: ${e.toString()}`); } } if (parsedArgs.extensionDevelopmentPath) {

if (waitMarkerFilePath) { waitForFileDeleted(waitMarkerFilePath); } <ins> if (readFromStdinPromise) { await readFromStdinPromise; } </ins> } }