Migrate core render util to use xterm.js as part of the rendering loop. (#19044)

This commit is contained in:
Jacob Richman
2026-02-18 16:46:50 -08:00
committed by GitHub
parent 04c52513e7
commit 04f65f3d55
213 changed files with 7065 additions and 3852 deletions

View File

@@ -2064,7 +2064,7 @@ describe('InputPrompt', () => {
);
await waitFor(() => {
const frame = stdout.lastFrame();
const lines = frame!.split('\n');
const lines = frame.split('\n');
// The line with the cursor should just be an inverted space inside the box border
expect(
lines.find((l) => l.includes(chalk.inverse(' '))),
@@ -2101,7 +2101,7 @@ describe('InputPrompt', () => {
expect(frame).toContain('hello');
expect(frame).toContain(`world${chalk.inverse(' ')}`);
const outputLines = frame!.split('\n');
const outputLines = frame.trim().split('\n');
// The number of lines should be 2 for the border plus 3 for the content.
expect(outputLines.length).toBe(5);
});
@@ -3349,7 +3349,7 @@ describe('InputPrompt', () => {
return <InputPrompt {...baseProps} buffer={buffer as TextBuffer} />;
};
const { stdin, stdout, unmount, simulateClick } = renderWithProviders(
const { stdout, unmount, simulateClick } = renderWithProviders(
<TestWrapper />,
{
mouseEventsEnabled: true,
@@ -3364,8 +3364,8 @@ describe('InputPrompt', () => {
});
// Simulate double-click to expand
await simulateClick(stdin, 5, 2);
await simulateClick(stdin, 5, 2);
await simulateClick(5, 2);
await simulateClick(5, 2);
// 2. Verify expanded content is visible
await waitFor(() => {
@@ -3373,8 +3373,8 @@ describe('InputPrompt', () => {
});
// Simulate double-click to collapse
await simulateClick(stdin, 5, 2);
await simulateClick(stdin, 5, 2);
await simulateClick(5, 2);
await simulateClick(5, 2);
// 3. Verify placeholder is restored
await waitFor(() => {
@@ -3440,7 +3440,7 @@ describe('InputPrompt', () => {
return <InputPrompt {...baseProps} buffer={buffer as TextBuffer} />;
};
const { stdin, stdout, unmount, simulateClick } = renderWithProviders(
const { stdout, unmount, simulateClick } = renderWithProviders(
<TestWrapper />,
{
mouseEventsEnabled: true,
@@ -3455,8 +3455,8 @@ describe('InputPrompt', () => {
});
// Simulate double-click WAY to the right on the first line
await simulateClick(stdin, 100, 2);
await simulateClick(stdin, 100, 2);
await simulateClick(90, 2);
await simulateClick(90, 2);
// Verify it is NOW collapsed
await waitFor(() => {