Bus UI Terminal

TerminalSessionPanel renders one terminal session.

Use it for a public-safe session card that combines command context, status, output chunks, and optional input controls.

Public API

TerminalSessionPanel(props TerminalSessionPanelProps) gx.Node

When to use it

Use TerminalSessionPanel when the host wants one terminal surface to present the command, working directory, session identifiers, state, and output stream together.

Key props

ID, Title, Summary, State, Command, WorkingDirectory, SessionID, ProcessID, Elapsed, ExitCode, Output, EmptyOutput, OnSubmit, and OnExit.

Example

Loading TerminalSessionPanel demo...

Go API

import (
  gx "github.com/busdk/bus-gx/pkg/gx"
  terminalui "github.com/busdk/bus-ui/pkg/terminalui"
)

node := terminalui.TerminalSessionPanel(terminalui.TerminalSessionPanelProps{
  Title:      "Verification",
  Command:    "go test ./...",
  SessionID:  "sess_123",
  State:      terminalui.TerminalSessionStateRunning,
  EmptyOutput: "No output yet.",
})

html, err := gx.RenderHTML(node)

.gx source

In .gx source, author the visible component state as GX markup. Keep the Go API block above for the package helper or render-boundary call.

package busuiexamples

import gx "github.com/busdk/bus-gx/pkg/gx"

func TerminalSessionPanelExample() gx.Node {
  return <section class="terminal-session">
  <header><h2><Text value={"Verification"}></Text></h2><p><Text value={"go test ./..."}></Text></p></header>
  <pre aria-label="Terminal output"><Text value={"No output yet."}></Text></pre>
  <form method="post"><input name="command" type="text"></input><button type="submit"><Text value={"Run"}></Text></button></form>
</section>
}

Related

Return to Terminal or the Bus UI reference.