Skip to content

Commit b7894e6

Browse files
authored
Fail to read from stdin (fix microsoft#229962) (microsoft#229968)
Fail to read from stdin (microsoft#229962)
1 parent 1b22d60 commit b7894e6

File tree

1 file changed

+5
-5
lines changed
  • src/vs/platform/environment/node

1 file changed

+5
-5
lines changed

src/vs/platform/environment/node/stdin.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ export function getStdinFilePath(): string {
4141
export async function readFromStdin(targetPath: string, verbose: boolean, onEnd?: Function): Promise<void> {
4242

4343
let [encoding, iconv] = await Promise.all([
44-
resolveTerminalEncoding(verbose), // respect terminal encoding when piping into file
45-
import('@vscode/iconv-lite-umd'), // lazy load encoding module for usage
46-
fs.promises.appendFile(targetPath, '') // make sure file exists right away (https://github.com/microsoft/vscode/issues/155341)
44+
resolveTerminalEncoding(verbose), // respect terminal encoding when piping into file
45+
import('@vscode/iconv-lite-umd'), // lazy load encoding module for usage
46+
fs.promises.appendFile(targetPath, '') // make sure file exists right away (https://github.com/microsoft/vscode/issues/155341)
4747
]);
4848

49-
if (!iconv.encodingExists(encoding)) {
49+
if (!iconv.default.encodingExists(encoding)) {
5050
console.log(`Unsupported terminal encoding: ${encoding}, falling back to UTF-8.`);
5151
encoding = 'utf8';
5252
}
@@ -59,7 +59,7 @@ export async function readFromStdin(targetPath: string, verbose: boolean, onEnd?
5959

6060
const appendFileQueue = new Queue();
6161

62-
const decoder = iconv.getDecoder(encoding);
62+
const decoder = iconv.default.getDecoder(encoding);
6363

6464
process.stdin.on('data', chunk => {
6565
const chunkStr = decoder.write(chunk);

0 commit comments

Comments
 (0)