From e63184f91db4997af754e661ddb651e1033226fc Mon Sep 17 00:00:00 2001 From: ace-pm Date: Tue, 21 Apr 2026 00:56:18 +0200 Subject: [PATCH] fix(migrations): drop press-any-key block to avoid stdin wedge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit showDeprecationWarnings ran setRawMode(true)/once('data')/setRawMode(false)/ pause() right before pi-tui's own stdin setup. That handoff is fragile — buffered bytes and mode flips between the migration prompt and the TUI's raw-mode setup can leave stdin cooked and line-buffered, producing the 'Enter does nothing + garbled typing' symptom. Warnings now print non-blocking. They stay visible in scrollback above the TUI, so users still see them without a blocking acknowledge step. --- packages/pi-coding-agent/src/migrations.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/pi-coding-agent/src/migrations.ts b/packages/pi-coding-agent/src/migrations.ts index a59e1895b..3d985e6c2 100644 --- a/packages/pi-coding-agent/src/migrations.ts +++ b/packages/pi-coding-agent/src/migrations.ts @@ -253,7 +253,9 @@ function migrateExtensionSystem(cwd: string): string[] { } /** - * Print deprecation warnings and wait for keypress. + * Print deprecation warnings. Non-blocking — does not wait for keypress so + * stdin state is not disturbed before the TUI initialises its own raw-mode + * handler. The warnings remain visible in the scrollback above the TUI. */ export async function showDeprecationWarnings(warnings: string[]): Promise { if (warnings.length === 0) return; @@ -264,17 +266,6 @@ export async function showDeprecationWarnings(warnings: string[]): Promise console.log(chalk.yellow(`\nMove your extensions to the extensions/ directory.`)); console.log(chalk.yellow(`Migration guide: ${MIGRATION_GUIDE_URL}`)); console.log(chalk.yellow(`Documentation: ${EXTENSIONS_DOC_URL}`)); - console.log(chalk.dim(`\nPress any key to continue...`)); - - await new Promise((resolve) => { - process.stdin.setRawMode?.(true); - process.stdin.resume(); - process.stdin.once("data", () => { - process.stdin.setRawMode?.(false); - process.stdin.pause(); - resolve(); - }); - }); console.log(); }