API: `tsc.exe` opens a visible console window on Windows when the parent process has no console
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 75/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- node.js, typescript
Direção de pesquisa
Comece pelas chamadas que iniciam processos em dist/api/syncChannel.js e dist/api/async/client.js e, em seguida, verifique os arquivos-fonte e os testes correspondentes. Reproduza o relato no Windows usando o launcher fornecido e verifique os dois caminhos da API. O objetivo é que tsc.exe seja iniciado sem uma janela de console visível quando o processo pai não tiver um console.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
🔎 Search Terms
windowsHide, tsc.exe console window, API console window Windows spawn, SyncRpcChannel, ELECTRON_RUN_AS_NODE, cmd window opens, console window flash Windows, conhost tsc
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about Windows console windows and the API
I reproduced this on 7.0.2, 7.1.0-beta, and 7.1.0-dev.20261031.1. TypeScript 6.0.3 does not export this API.
⏯ Playground Link
No response
💻 Code
Install typescript@next in an empty directory on Windows and add these two files.
api-console.mjs (on 7.0.2, import from typescript/unstable/sync):
import { API } from "typescript/sync";
const api = new API({ cwd: process.cwd() });
setTimeout(() => api.close(), 8_000);
launch.mjs (replace the path with your VS Code installation):
import { spawn } from "node:child_process";
const env = { ...process.env, ELECTRON_RUN_AS_NODE: "1" };
spawn("C:/path/to/Microsoft VS Code/Code.exe", ["api-console.mjs"], {
detached: true,
stdio: "ignore",
env,
}).unref();
Run node launch.mjs.
detached: true starts Code.exe without a console. Running api-console.mjs directly with Node from a terminal does not show the problem.
🙁 Actual behavior
A console window opens and stays open until the API closes. Its title is the path of tsc.exe. In my environment, Windows Terminal is the default terminal application, so the window opens in Windows Terminal.
This is wrong because the API communicates through pipes, so users have no reason to see this window. Tools that start one API for each project or restart the API open several windows. I found this in a VS Code extension.
🙂 Expected behavior
tsc.exe runs without a visible window, regardless of whether the parent process has a console.
Additional information about the issue
Code.exe is a GUI subsystem program, so it has no console even when it runs with ELECTRON_RUN_AS_NODE=1. Windows therefore creates a new console for tsc.exe. Other Electron-based hosts should behave the same way, but I tested only Code.exe.
These calls do not pass windowsHide in the published 7.1.0-dev.20261031.1 package:
dist/api/syncChannel.js: the call that startstsc.exewith--pipedist/api/async/client.js: the call that startstsc.exewith stdio pipes
Passing windowsHide: true in these calls should fix the problem. I confirmed this on 7.0.2 with the sync API: the unchanged script opened one window, and a run with windowsHide: true added to spawn opened none. tsc.exe started in both runs. I did not run the async API.
As a workaround, we temporarily replace child_process.spawn, call syncBuiltinESMExports(), and construct API. This works only because the sync API spawns in its constructor, and it depends on internal behavior.
AI Disclosure: Used Claude Opus 5.5 for investigation and writing.
- Linguagem predominante
- Go
- Estrelas
- 112k
- Forks
- 16k
- Merge médio
- 3d 6h
- PRs com merge (30d)
- 136
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoft/TypeScript
-
Native API: formatDiagnosticsWithColorAndContext drops related information without a file locationAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
microsoft/TypeScript#65087 ·
Mantenedores costumam responder em até 1 dia
-
TS7 LSP: documentHighlight returns nothing when the file path contains '@'Talvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. AbertaBug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
microsoft/TypeScript#64758 ·
Mantenedores costumam responder em até 1 dia
-
Language server (tsc --lsp) exits with code 1 after `shutdown` and `exit`Talvez já em andamento @rajnish-verma-22172 assumiu há 12 dias. AbertaBug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
microsoft/TypeScript#64742 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Class names `eval` and `arguments` are not reported as invalid strict mode bindingsTalvez já em andamento @dmety assumiu há 25 dias. AbertaBug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
microsoft/TypeScript#64661 ·
Mantenedores costumam responder em até 1 dia
-
Non-enum CLI options with multiple values separated by comma and space aren't whitespace trimmedTalvez já em andamento @RyanCavanaugh assumiu há 26 dias. AbertaBug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
microsoft/TypeScript#64618 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de microsoft/TypeScript
Issues semelhantes
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 65/100
influxdata/telegraf#20031 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
OneBusAway/maglev#1914 ·
Mantenedores costumam responder em até 2 dias
-
bug needs-acceptance wg/data-plane-networking
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
vllm-project/semantic-router#5680 ·
Mantenedores costumam responder em até 2 dias
-
documentation needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 1 dia
-
go good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia