Merge pull request #7643 from continuedev/dallin/enter-to-continue

feat: cli: press enter to continue
This commit is contained in:
Nate Sesti 2025-09-08 22:21:34 -07:00 • committed by GitHub
commit a297b78597
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 14 deletions

View file

@ -310,7 +310,7 @@
"@types/node": "^20.11.19",
"@types/shell-quote": "^1.7.5",
"typescript": "^5.5.2",
"vitest": "^1.6.0"
"vitest": "^3.2.4"
}
},
"node_modules/@alcalzone/ansi-tokenize": {

View file

@ -4,7 +4,7 @@ import React, { useMemo } from "react";
// Array of helpful tips for Continue CLI users
const CONTINUE_CLI_TIPS = [
"Use `/help` to learn keyboard shortcuts",
"Press escape to pause cn, and press enter to resume",
"Press escape to pause cn, and press enter to continue",
"Use arrow keys (↑/↓) to navigate through your input history",
'Multi-line input is supported by typing "\\" and pressing enter',
"Use `cn ls` or `/resume` to resume a previous conversation",

View file

@ -27,7 +27,7 @@ const InterruptedBanner: React.FC<{ wasInterrupted: boolean }> = ({
if (!wasInterrupted) return null;
return (
<Box paddingX={1} marginBottom={0}>
<Text color="yellow">⚠ Interrupted by user - Press enter to resume</Text>
<Text color="yellow">Interrupted by user - Press enter to continue</Text>
</Box>
);
};

View file

@ -1,6 +1,6 @@
import { render } from "ink-testing-library";
import React from "react";
import { vi, expect, describe, it, beforeEach, afterEach } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { UserInput } from "../UserInput.js";
@ -32,8 +32,8 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => {
// Initial render - no interruption message
let frame = lastFrame();
expect(frame).toBeDefined();
expect(frame).not.toContain("⚠ Interrupted by user");
expect(frame).not.toContain("Press enter to resume");
expect(frame).not.toContain("Interrupted by user");
expect(frame).not.toContain("Press enter to continue");
// Re-render with wasInterrupted: true
rerender(
@ -49,8 +49,8 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => {
// Should show interruption message
frame = lastFrame();
expect(frame).toBeDefined();
expect(frame).toContain("⚠ Interrupted by user");
expect(frame).toContain("Press enter to resume");
expect(frame).toContain("Interrupted by user");
expect(frame).toContain("Press enter to continue");
} finally {
unmount();
}
@ -74,8 +74,8 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => {
// Initial render - should show interruption message
let frame = lastFrame();
expect(frame).toBeDefined();
expect(frame).toContain("⚠ Interrupted by user");
expect(frame).toContain("Press enter to resume");
expect(frame).toContain("Interrupted by user");
expect(frame).toContain("Press enter to continue");
// Re-render with wasInterrupted: false
rerender(
@ -91,8 +91,8 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => {
// Should not show interruption message
frame = lastFrame();
expect(frame).toBeDefined();
expect(frame).not.toContain("⚠ Interrupted by user");
expect(frame).not.toContain("Press enter to resume");
expect(frame).not.toContain("Interrupted by user");
expect(frame).not.toContain("Press enter to continue");
} finally {
unmount();
}
@ -177,10 +177,10 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => {
let foundInputBoxLine = -1;
frameLines.forEach((line, index) => {
if (line.includes("⚠ Interrupted by user")) {
if (line.includes("Interrupted by user")) {
foundInterruptionLine = index;
}
if (line.includes("●") && line.includes("▋")) {
if (line.includes("●") || line.includes("▋")) {
foundInputBoxLine = index;
}
});