@@ -10,7 +10,7 @@ import { TerminalPanel } from "./panel-terminal.js"
1010import { type BrowserScreen , projectPickerScreen } from "./screen.js"
1111import { shouldShowTerminalTabs } from "./terminal-mobile-layout.js"
1212import { terminalSessionId } from "./terminal-state.js"
13- import { isPendingActiveTerminalSession , type ActiveTerminalSession } from "./terminal.js"
13+ import { type ActiveTerminalSession , isPendingActiveTerminalSession } from "./terminal.js"
1414
1515type TerminalWorkspaceView = "terminal" | "tasks"
1616
@@ -369,8 +369,9 @@ const TerminalPane = (
369369 const browserProjectKey = terminalSession . browserProjectKey
370370 const canOpenBrowser = canOpenProjectBrowser ( projectBrowser , browserProjectId )
371371 const pendingSession = isPendingActiveTerminalSession ( terminalSession )
372- const bodyContent = taskManagerOpen && browserProjectId !== undefined
373- ? (
372+ let bodyContent : JSX . Element | undefined
373+ if ( taskManagerOpen && browserProjectId !== undefined ) {
374+ bodyContent = (
374375 < TerminalTaskManagerBody
375376 onClose = { onCloseTaskManager }
376377 onLoadProjectTaskLogs = { onLoadProjectTaskLogs }
@@ -384,9 +385,9 @@ const TerminalPane = (
384385 selectedProjectSummary = { selectedProjectSummary }
385386 />
386387 )
387- : pendingSession
388- ? < PendingTerminalBody session = { terminalSession } />
389- : undefined
388+ } else if ( pendingSession ) {
389+ bodyContent = < PendingTerminalBody session = { terminalSession } />
390+ }
390391 const detachTerminalSession = ( ) : void => {
391392 onTerminalClose ( sessionId )
392393 if ( singleSession ) {
@@ -404,15 +405,19 @@ const TerminalPane = (
404405 } }
405406 onDetach = { ( ) => {
406407 detachTerminalSession ( )
407- onTerminalMessage ( `${ pendingSession ? "Closed pending" : "Detached" } SSH terminal: ${ terminalSession . session . id } .` )
408+ onTerminalMessage (
409+ `${ pendingSession ? "Closed pending" : "Detached" } SSH terminal: ${ terminalSession . session . id } .`
410+ )
408411 } }
409412 onKill = { ( ) => {
410413 if ( ! pendingSession ) {
411414 requestTerminalSessionClose ( terminalSession . closePath )
412415 terminalSession . onExit ?.( )
413416 }
414417 detachTerminalSession ( )
415- onTerminalMessage ( `${ pendingSession ? "Closed pending" : "Killed" } SSH terminal: ${ terminalSession . session . id } .` )
418+ onTerminalMessage (
419+ `${ pendingSession ? "Closed pending" : "Killed" } SSH terminal: ${ terminalSession . session . id } .`
420+ )
416421 } }
417422 onOpenBrowser = { browserProjectId === undefined || ! canOpenBrowser
418423 ? undefined
0 commit comments