Fit chat terminals to their output, keep pastes and keys in the terminal
Finished terminals are sized synchronously from their rows at the view's width (the post-frame fit made the transcript re-anchor forever); blank rows xterm.dart keeps when rewrapping are dropped; desktop typing uses key events; the composer leaves Cmd/Ctrl-V to a focused terminal; Ctrl-A reaches the process. The probe fixture gains coloured terminal runs and an interactive login. Notes record behaviour, protocol, security and verification.
This commit is contained in:
@@ -48,7 +48,16 @@ func TestChatShellStopKillsAfterGrace(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(150 * time.Millisecond)
|
||||
// The trap must be in place before the stop: wait for the command's
|
||||
// output rather than a fixed delay (a login shell can be slow to start).
|
||||
for deadline := time.Now().Add(10 * time.Second); ; time.Sleep(10 * time.Millisecond) {
|
||||
if record, err := runner.Read(context.Background(), "ses_1", run.ID); err == nil && strings.Contains(record.Output, "ready") {
|
||||
break
|
||||
}
|
||||
if time.Now().After(deadline) {
|
||||
t.Fatal("the command never printed ready")
|
||||
}
|
||||
}
|
||||
if _, err := runner.Stop("ses_2", run.ID); err == nil {
|
||||
t.Fatal("another session stopped this run")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user