Merge branch 'worktree-agent-ab9de97501bc94a9c'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -377,6 +377,47 @@ void main() {
|
||||
expect(gateway.bodies('chat_shell_input'), isEmpty);
|
||||
});
|
||||
|
||||
testWidgets('focusing the terminal claims it at its size; typing carries '
|
||||
'the size and query answers are marked', (tester) async {
|
||||
await openRunning(tester, output: 'size? \x1b[6n');
|
||||
await tester.pump(const Duration(milliseconds: 200));
|
||||
final laidOut = gateway.bodies('chat_shell_resize').single;
|
||||
// The replayed query is not answered; nothing was claimed yet.
|
||||
expect(gateway.bodies('chat_shell_input'), isEmpty);
|
||||
await tester.tap(find.byType(TerminalView));
|
||||
await tester.pump();
|
||||
final claim = gateway.bodies('chat_shell_resize').last;
|
||||
expect(claim['activate'], isTrue);
|
||||
expect((claim['cols'], claim['rows']), (laidOut['cols'], laidOut['rows']));
|
||||
// Typing carries this client's size.
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.keyG);
|
||||
await tester.pump();
|
||||
var inputs = gateway.bodies('chat_shell_input');
|
||||
expect(inputs.single['data'], 'g');
|
||||
expect(inputs.single['reply'], isNull);
|
||||
expect(
|
||||
(inputs.single['cols'], inputs.single['rows']),
|
||||
(laidOut['cols'], laidOut['rows']),
|
||||
);
|
||||
// A live query is answered with the answer marked, without a size.
|
||||
gateway.emitOutput('run_t', '\x1b[6n', 'size? \x1b[6n'.length);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
inputs = gateway.bodies('chat_shell_input');
|
||||
expect(inputs.last['data'], '\x1b[1;7R');
|
||||
expect(inputs.last['reply'], isTrue);
|
||||
expect(inputs.last['cols'], isNull);
|
||||
// Focusing again after the focus left claims again.
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
await tester.pump();
|
||||
await tester.tap(find.byType(TerminalView));
|
||||
await tester.pump();
|
||||
expect(
|
||||
gateway.bodies('chat_shell_resize').where((b) => b['activate'] == true),
|
||||
hasLength(2),
|
||||
);
|
||||
}, variant: TargetPlatformVariant.only(TargetPlatform.linux));
|
||||
|
||||
testWidgets('coloured output is drawn without its escape codes', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in New Issue
Block a user