thincoder 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/tui/cmd-exit.mjs +6 -16
package/package.json
CHANGED
package/src/tui/cmd-exit.mjs
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
/** /exit command: exit TUI (same path as Ctrl+C).
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export async function handleExitCommand(
|
|
8
|
-
const { agent, state } = ctx
|
|
9
|
-
// Same cleanup sequence as Ctrl+C in key-handler.mjs
|
|
10
|
-
try {
|
|
11
|
-
archiveCurrent(agent.cwd)
|
|
12
|
-
saveSession(agent, state.lines)
|
|
13
|
-
} catch { /* save failure shouldn't block exit */ }
|
|
14
|
-
try { closeAllMcp(agent) } catch { /* exiting anyway */ }
|
|
15
|
-
process.stdin.setRawMode(false)
|
|
16
|
-
process.stdout.write(ansi.clearScreen + ansi.mouseOff + ansi.bracketedPasteOff + ansi.mainBuffer + ansi.showCursor + ansi.reset)
|
|
17
|
-
// Exit synchronously — prevents post-handler render() from redrawing the TUI
|
|
2
|
+
* Direct synchronous process.exit — prevents the post-handler render()
|
|
3
|
+
* from redrawing the TUI over the cleaned terminal. The actual cleanup
|
|
4
|
+
* (archiveCurrent + saveSession + closeMcp + terminal reset) runs once
|
|
5
|
+
* via the process.on("exit") handler registered in index.mjs.
|
|
6
|
+
*/
|
|
7
|
+
export async function handleExitCommand(_ctx) {
|
|
18
8
|
process.exit(0)
|
|
19
9
|
}
|