feat: support suspending ui (#173)

Co-authored-by: Shubham Naik <shub@memgpt.ai>
This commit is contained in:
Shubham Naik
2025-12-10 16:14:34 -08:00
committed by GitHub
parent 6db2fcfc05
commit 410b1ffb97
3 changed files with 53 additions and 4 deletions

View File

@@ -1,8 +1,7 @@
// Import useInput from vendored Ink for bracketed paste support
import { Box, Text, useInput } from "ink";
import SpinnerLib from "ink-spinner";
import type { ComponentType } from "react";
import { useEffect, useRef, useState } from "react";
import { type ComponentType, useEffect, useRef, useState } from "react";
import { LETTA_CLOUD_API_URL } from "../../auth/oauth";
import type { PermissionMode } from "../../permissions/mode";
import { permissionMode } from "../../permissions/mode";
@@ -155,9 +154,10 @@ export function Input({
}
});
// Handle CTRL-C for double-ctrl-c-to-exit
useInput((input, key) => {
if (!visible) return;
// Handle CTRL-C for double-ctrl-c-to-exit
if (input === "c" && key.ctrl) {
if (ctrlCPressed) {
// Second CTRL-C - call onExit callback which handles stats and exit