fix(coding-agent): preserve final TUI frame on quit
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed `/quit` shutdown ordering to stop the TUI before extension UI teardown can repaint, preserving the final rendered frame while still emitting `session_shutdown` before process exit.
|
||||||
- Fixed `SettingsManager.inMemory()` initial settings being lost after reloads triggered by SDK resource loading ([#3616](https://github.com/badlogic/pi-mono/issues/3616))
|
- Fixed `SettingsManager.inMemory()` initial settings being lost after reloads triggered by SDK resource loading ([#3616](https://github.com/badlogic/pi-mono/issues/3616))
|
||||||
- Fixed `models.json` provider compatibility to accept `compat.supportsLongCacheRetention`, allowing proxies to opt out of long-retention cache fields when needed while long retention is enabled by default when requested ([#3543](https://github.com/badlogic/pi-mono/issues/3543))
|
- Fixed `models.json` provider compatibility to accept `compat.supportsLongCacheRetention`, allowing proxies to opt out of long-retention cache fields when needed while long retention is enabled by default when requested ([#3543](https://github.com/badlogic/pi-mono/issues/3543))
|
||||||
- Fixed `--thinking xhigh` for `openai-codex` `gpt-5.5` so it is no longer downgraded to `high`.
|
- Fixed `--thinking xhigh` for `openai-codex` `gpt-5.5` so it is no longer downgraded to `high`.
|
||||||
|
|||||||
@@ -3208,7 +3208,8 @@ export class InteractiveMode {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gracefully shutdown the agent.
|
* Gracefully shutdown the agent.
|
||||||
* Emits shutdown event to extensions, then exits.
|
* Stops the TUI before emitting shutdown events so extension UI cleanup cannot
|
||||||
|
* repaint the final frame while the process is exiting.
|
||||||
*/
|
*/
|
||||||
private isShuttingDown = false;
|
private isShuttingDown = false;
|
||||||
|
|
||||||
@@ -3216,17 +3217,13 @@ export class InteractiveMode {
|
|||||||
if (this.isShuttingDown) return;
|
if (this.isShuttingDown) return;
|
||||||
this.isShuttingDown = true;
|
this.isShuttingDown = true;
|
||||||
this.unregisterSignalHandlers();
|
this.unregisterSignalHandlers();
|
||||||
await this.runtimeHost.dispose();
|
|
||||||
|
|
||||||
// Wait for any pending renders to complete
|
|
||||||
// requestRender() uses process.nextTick(), so we wait one tick
|
|
||||||
await new Promise((resolve) => process.nextTick(resolve));
|
|
||||||
|
|
||||||
// Drain any in-flight Kitty key release events before stopping.
|
// Drain any in-flight Kitty key release events before stopping.
|
||||||
// This prevents escape sequences from leaking to the parent shell over slow SSH.
|
// This prevents escape sequences from leaking to the parent shell over slow SSH.
|
||||||
await this.ui.terminal.drainInput(1000);
|
await this.ui.terminal.drainInput(1000);
|
||||||
|
|
||||||
this.stop();
|
this.stop();
|
||||||
|
await this.runtimeHost.dispose();
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user