API: `tsc.exe` opens a visible console window on Windows when the parent process has no console
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
Direzione di ricerca
Inizia dalle chiamate che avviano processi in dist/api/syncChannel.js e dist/api/async/client.js, poi controlla i file sorgente e i test corrispondenti. Riproduci la segnalazione su Windows usando il launcher fornito e verifica entrambi i percorsi API. L’obiettivo è che tsc.exe si avvii senza una finestra della console visibile quando il processo padre non ha una console.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🔎 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.
- Lingua principale
- Go
- Stelle
- 112k
- Fork
- 16k
- Merge medio
- 3g 4h
- PR unite (30g)
- 145
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/TypeScript
-
TS7 LSP: documentHighlight returns nothing when the file path contains '@'Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. ApertaBug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/TypeScript#64758 ·
I maintainer di solito rispondono entro 1 giorno
-
Language server (tsc --lsp) exits with code 1 after `shutdown` and `exit`Forse già presa @rajnish-verma-22172 l’ha presa 11 giorni fa. ApertaBug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
microsoft/TypeScript#64742 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Class names `eval` and `arguments` are not reported as invalid strict mode bindingsForse già presa @dmety l’ha presa 24 giorni fa. ApertaBug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoft/TypeScript#64661 ·
I maintainer di solito rispondono entro 1 giorno
-
Non-enum CLI options with multiple values separated by comma and space aren't whitespace trimmedForse già presa @RyanCavanaugh l’ha presa 25 giorni fa. ApertaBug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoft/TypeScript#64618 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
TypeScript 7 VS Code extension: a workspace "typescript" 7.x package is not detected, only "@typescript/native-preview", which is no longer publishedForse già presa @jakebailey l’ha presa 25 giorni fa. ApertaNeeds Investigation
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoft/TypeScript#64565 · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/TypeScript
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
caddyserver/caddy#8314 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
hashicorp/golang-lru#245 ·
-
graphite: empty metric registry logs nil as an error and still dialsForse già presa @helmipradita l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
prometheus/client_golang#2203 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
spotify/flink-on-k8s-operator#1075 ·