feat: support suspending ui (#173)
Co-authored-by: Shubham Naik <shub@memgpt.ai>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user