fix: input keyboard shortcuts (#676)

Fixes keyboard shortcuts:
- ctrl+a/e
- opt+arrow keys
This commit is contained in:
Fouad Matin
2025-04-25 16:58:09 -07:00
committed by GitHub
parent f3ee933a74
commit 3f4762d969
4 changed files with 66 additions and 21 deletions

View File

@@ -106,11 +106,16 @@ export default function TerminalChatInputThinking({
return (
<Box flexDirection="column" gap={1}>
<Box gap={2}>
<Text>{frameWithSeconds}</Text>
<Box justifyContent="space-between">
<Box gap={2}>
<Text>{frameWithSeconds}</Text>
<Text>
Thinking
{dots}
</Text>
</Box>
<Text>
Thinking
{dots}
Press <Text bold>Esc</Text> twice to interrupt
</Text>
</Box>
{awaitingConfirm && (

View File

@@ -412,7 +412,7 @@ export default function TerminalChatInput({
setInput("");
openApprovalOverlay();
return;
} else if (inputValue === "exit") {
} else if (["exit", "q", ":q"].includes(inputValue)) {
setInput("");
setTimeout(() => {
app.exit();
@@ -881,20 +881,30 @@ function TerminalChatInputThinking({
);
return (
<Box flexDirection="column" gap={1}>
<Box gap={2}>
<Text>{frameWithSeconds}</Text>
<Box width="100%" flexDirection="column" gap={1}>
<Box
flexDirection="row"
width="100%"
justifyContent="space-between"
paddingRight={1}
>
<Box gap={2}>
<Text>{frameWithSeconds}</Text>
<Text>
Thinking
{dots}
</Text>
</Box>
<Text>
Thinking
{dots}
<Text dimColor>press</Text> <Text bold>Esc</Text>{" "}
{awaitingConfirm ? (
<Text bold>again</Text>
) : (
<Text dimColor>twice</Text>
)}{" "}
<Text dimColor>to interrupt</Text>
</Text>
</Box>
{awaitingConfirm && (
<Text dimColor>
Press <Text bold>Esc</Text> again to interrupt and enter a new
instruction
</Text>
)}
</Box>
);
}

View File

@@ -73,7 +73,7 @@ const TerminalHeader: React.FC<TerminalHeaderProps> = ({
</Text>
<Text dimColor>
<Text color="blueBright"></Text> approval:{" "}
<Text bold color={colorsByPolicy[approvalPolicy]} dimColor>
<Text bold color={colorsByPolicy[approvalPolicy]}>
{approvalPolicy}
</Text>
</Text>