diff --git a/packages/cli/src/ui/components/StatusRow.test.tsx b/packages/cli/src/ui/components/StatusRow.test.tsx index b80dbacabe..94bb98af39 100644 --- a/packages/cli/src/ui/components/StatusRow.test.tsx +++ b/packages/cli/src/ui/components/StatusRow.test.tsx @@ -13,6 +13,7 @@ import { type TextBuffer } from '../components/shared/text-buffer.js'; import { type SessionStatsState } from '../contexts/SessionContext.js'; import { type ThoughtSummary } from '../types.js'; import { ApprovalMode } from '@google/gemini-cli-core'; +import { INTERACTIVE_SHELL_WAITING_PHRASE } from '../hooks/usePhraseCycler.js'; vi.mock('../hooks/useComposerStatus.js', () => ({ useComposerStatus: vi.fn(), @@ -106,7 +107,7 @@ describe('', () => { ); await waitUntilReady(); - expect(lastFrame()).toContain('! Shell awaiting input (Tab to focus)'); + expect(lastFrame()).toContain(INTERACTIVE_SHELL_WAITING_PHRASE); }); it('renders tip with absolute positioning when it fits but might collide (verification of container logic)', async () => { diff --git a/packages/core/src/services/shellExecutionService.ts b/packages/core/src/services/shellExecutionService.ts index 78c2fc803e..710a861894 100644 --- a/packages/core/src/services/shellExecutionService.ts +++ b/packages/core/src/services/shellExecutionService.ts @@ -46,6 +46,19 @@ import { } from './executionLifecycleService.js'; const { Terminal } = pkg; +/** + * Internal interfaces to access non-public xterm properties. + */ +interface XTermCore { + coreService: { + isCursorHidden: boolean; + }; +} + +interface XTermInternal { + _core?: XTermCore; +} + const MAX_CHILD_PROCESS_BUFFER_SIZE = 16 * 1024 * 1024; // 16MB /** @@ -952,9 +965,10 @@ export class ShellExecutionService { if (output !== finalOutput) { output = finalOutput; - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-type-assertion - const isCursorHidden = (headlessTerminal as any)._core?.coreService - ?.isCursorHidden as boolean | undefined; + const isCursorHidden = + // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion + (headlessTerminal as unknown as XTermInternal)._core?.coreService + ?.isCursorHidden; const event: ShellOutputEvent = { type: 'data', chunk: finalOutput, @@ -1307,9 +1321,10 @@ export class ShellExecutionService { startLine, endLine, ); - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-type-assertion - const isCursorHidden = (activePty.headlessTerminal as any)._core - ?.coreService?.isCursorHidden as boolean | undefined; + const isCursorHidden = + // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion + (activePty.headlessTerminal as unknown as XTermInternal)._core + ?.coreService?.isCursorHidden; const event: ShellOutputEvent = { type: 'data', chunk: bufferData,