Terminal: a shell that ends while its panel is shown again is not replaced
Showing the panel connects a frame later (the panel needs its width first). A shell that ended before that frame -- reopened and closed by the server within one frame, as headless CI's slow frames made happen -- was quietly replaced by a new one, against "no reconnect of its own". The frame now connects only if no shell was open as the showing began. The cause of the B3 failures on GitHub since 94e903e; a test makes it happen every time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2 files changed
+23
-1
No files matched your search
+4
-1
@@ -280,6 +280,9 @@ export async function showTerminal(on) {
|
||||
ctx.layout(on)
|
||||
markOpen()
|
||||
if (!on) return
|
||||
// Whether this showing is to open a shell: none was open as it began. One that ends meanwhile
|
||||
// (before the frame below) is said, not quietly replaced.
|
||||
const wanted = !session
|
||||
try {
|
||||
await load()
|
||||
} catch {
|
||||
@@ -291,7 +294,7 @@ export async function showTerminal(on) {
|
||||
// A frame later: the panel has only just been shown and has no width to fit to yet.
|
||||
requestAnimationFrame(() => {
|
||||
refit()
|
||||
connect()
|
||||
if (wanted && terminalOpen()) connect()
|
||||
term.focus()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user