Code change:
Issue Type: <bBug</bany command line run or pipe another process that runs indefinitely to that a window does not open and the command does not return. The file should open and update as new data is piped to the code cli command. This works on the Mac when you run but does not work on Windows. This is not a 1.67.0 regression VS Code version: Code 1.67.0 (, 2022-05-04T12:06:02.889Z) OS version: Windows_NT x64 10.0. Restricted Mode: No <!-- generated by issue reporter --
This is probably related to the file watcher not recognizing changes to the file on Windows, have to debug why that is the case but might be a limitation of the single file watcher.
The underlying reason seems to be that writing to a file via stream API where the file handle is not closed does not trigger file events on Windows at least. Maybe as a workaround we have to use the less efficient method that opens a file handle each time and closes it.
<!-- 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!
I am still experiencing this issue on the version of insiders below. Version: 1.69.0-insider (user setup) Commit: Date: 2022-06-24T06:32:08.615Z (13 hrs ago) Electron: 18.3.4 Chromium: 100.0.4896.160 16.13.2 V8: 10.0.139.17-electron.0 OS: Windows_NT x64 10.0.
Here is how to verify: ensure you are on latest insiders from a terminal on Windows run verify output is updated
I tried on the latest insiders with that command and vscode-insiders still does not not open for me. If I run it hangs and never opens vscode-insiders If I run without the -t flag, it will open after the command completes. Version: 1.69.0-insider (user setup) Commit: Date: 2022-06-27T07:59:47.622Z (10 hrs ago) Electron: 18.3.5 Chromium: 100.0.4896.160 16.13.2 V8: 10.0.139.17-electron.0 OS: Windows_NT x64 10.0.
This works for me on Windows 11 with both Powershell and , but may need further investigation

Related discussion:
text: } // Pipe into tmp file using terminals encoding <ins> // Use a `Queue` to be able to use `appendFile` // which helps file watchers to be aware of the // changes because each append closes the underlying // file descriptor. // (https://github.com/microsoft/vscode/issues/148952) </ins> const decoder = iconv.getDecoder(encoding); <del> process.stdin.on('data', chunk => stdinFileStream.write(decoder.write(chunk))); </del> <ins> const appendFileQueue = new Queue(); process.stdin.on('data', chunk => { const chunkStr = decoder.write(chunk); appendFileQueue.queue(() => Promises.appendFile(targetPath, chunkStr)); }); </ins> process.stdin.on('end', () => { const end = decoder.end(); if (typeof end === 'string') { <del> stdinFileStream.write(end); </del> <ins> appendFileQueue.queue(() => Promises.appendFile(targetPath, end)); </ins> } <del> stdinFileStream.end(); </del> }); <del> process.stdin.on('error', error => stdinFileStream.destroy(error)); process.stdin.on('close', () => stdinFileStream.close()); </del> }