mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-21 05:52:35 +08:00
fix(cli): add kilocode_change markers
This commit is contained in:
@@ -2,8 +2,7 @@ import { useRenderer } from "@opentui/solid"
|
||||
import { createSimpleContext } from "./helper"
|
||||
import { FormatError, FormatUnknownError } from "@/cli/error"
|
||||
import { win32FlushInputBuffer } from "../win32"
|
||||
// kilocode_change - import resetTerminalState for mouse tracking cleanup
|
||||
import { resetTerminalState } from "@tui/util/terminal"
|
||||
import { resetTerminalState } from "@tui/util/terminal" // kilocode_change
|
||||
type Exit = ((reason?: unknown) => Promise<void>) & {
|
||||
message: {
|
||||
set: (value?: string) => () => void
|
||||
@@ -40,8 +39,7 @@ export const { use: useExit, provider: ExitProvider } = createSimpleContext({
|
||||
renderer.setTerminalTitle("")
|
||||
renderer.destroy()
|
||||
win32FlushInputBuffer()
|
||||
// kilocode_change - reset terminal state to disable mouse tracking
|
||||
resetTerminalState()
|
||||
resetTerminalState() // kilocode_change
|
||||
if (reason) {
|
||||
const formatted = FormatError(reason) ?? FormatUnknownError(reason)
|
||||
if (formatted) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { RGBA } from "@opentui/core"
|
||||
|
||||
// kilocode_change start
|
||||
/**
|
||||
* Write escape sequences to disable all mouse tracking modes and reset terminal state.
|
||||
* This is a safety net to ensure the terminal is clean after exit, even if the renderer's
|
||||
@@ -18,10 +19,10 @@ export function resetTerminalState() {
|
||||
try {
|
||||
process.stdout.write(sequences.join(""))
|
||||
} catch (err) {
|
||||
// kilocode_change - stdout may already be closed during exit
|
||||
console.error("resetTerminalState failed", err)
|
||||
}
|
||||
}
|
||||
// kilocode_change end
|
||||
|
||||
export namespace Terminal {
|
||||
export type Colors = Awaited<ReturnType<typeof colors>>
|
||||
|
||||
Reference in New Issue
Block a user