Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(frontend): The terminal is still shown when connecting to an agent. (#9603)

Hiep Leaa2cacab44ae
diff --git a/frontend/src/components/features/terminal/terminal.tsx b/frontend/src/components/features/terminal/terminal.tsx
index 692d82ccb2..24484cdbde 100644
--- a/frontend/src/components/features/terminal/terminal.tsx
+++ b/frontend/src/components/features/terminal/terminal.tsx
@@ -22,7 +22,14 @@ function Terminal() {
{t("DIFF_VIEWER$WAITING_FOR_RUNTIME")}
</div>
)}
- <div ref={ref} className="h-full w-full" />
+ <div
+ ref={ref}
+ className={
+ isRuntimeInactive
+ ? "w-0 h-0 opacity-0 overflow-hidden"
+ : "h-full w-full"
+ }
+ />
</div>
);
}
diff --git a/frontend/src/types/agent-state.tsx b/frontend/src/types/agent-state.tsx
index 2ac3dbe3a9..f86d44b8a2 100644
--- a/frontend/src/types/agent-state.tsx
+++ b/frontend/src/types/agent-state.tsx
@@ -15,6 +15,7 @@ export enum AgentState {
}
export const RUNTIME_INACTIVE_STATES = [
+ AgentState.INIT,
AgentState.LOADING,
AgentState.STOPPED,
AgentState.ERROR,