Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

861 B
Raw Blame
export type InitialSessionTerminalAutoCreateInput = {
  newlyCreatedWorkspace: boolean
  connected: boolean
  tabsLoaded: boolean
  visibleTabCount: number
  hasActiveTerminalHandle: boolean
  createInFlight: boolean
  sawSessionTabs: boolean
  autoCreatedForWorktree: boolean
}

// Only an always-empty newly created workspace auto-creates: once tabs existed, later emptiness may be an intentional close and must not resurrect a terminal.
export function shouldAutoCreateInitialSessionTerminal(
  input: InitialSessionTerminalAutoCreateInput
): boolean {
  if (!input.newlyCreatedWorkspace || !input.connected || !input.tabsLoaded) {
    return false
  }
  if (input.visibleTabCount > 0 || input.hasActiveTerminalHandle) {
    return false
  }
  if (input.createInFlight || input.autoCreatedForWorktree) {
    return false
  }
  return !input.sawSessionTabs
}