A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.
Rust agentagent-orchestrationaiai-agentsclaude-codecodexcoding-agentlinuxmacosmultiplayermultiplexerrustterminalterminal-emulatorterminal-multiplexertmuxtuiweztermwindows
mobile: no dot in the bar; the connection lives in the sidebar sheet
RoversXaef28c9903b6
diff --git a/android/app/src/main/java/com/roversx/thinkterm/TerminalScreen.kt b/android/app/src/main/java/com/roversx/thinkterm/TerminalScreen.ktindex cd184e67..c52d1ddf 100644--- a/android/app/src/main/java/com/roversx/thinkterm/TerminalScreen.kt+++ b/android/app/src/main/java/com/roversx/thinkterm/TerminalScreen.kt@@ -273,7 +273,6 @@ fun TerminalScreen(host: Host, store: HostStore, onBack: () -> Unit) {onBack = { model.disconnect(); onBack() },onTree = { showTree = true },onOverview = { if (overviewShown) closeOverview() else openOverview() },- onEditHost = { editingHost = model.host },)// The tab strip fades with the zoom and stops taking touches;// its room stays, so the terminal's own place does not move@@ -419,7 +418,7 @@ fun TerminalScreen(host: Host, store: HostStore, onBack: () -> Unit) {}if (showTree) {- TreeSheet(model = model, onDismiss = { showTree = false })+ TreeSheet(model = model, onDismiss = { showTree = false }, onEditHost = { showTree = false; editingHost = model.host })}if (showSettings) {Box(Modifier.fillMaxSize().zIndex(3f).background(MaterialTheme.colorScheme.background)) {@@ -459,9 +458,7 @@ private fun TopBar(onBack: () -> Unit,onTree: () -> Unit,onOverview: () -> Unit,- onEditHost: () -> Unit,) {- var connectionMenu by remember { mutableStateOf(false) }Row(Modifier.fillMaxWidth().height(48.dp).padding(start = 2.dp, end = 2.dp),verticalAlignment = Alignment.CenterVertically,@@ -469,19 +466,6 @@ private fun TopBar(IconButton(onClick = onBack) {Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = tr("back"), tint = Color.White)}- // The dot is the connection: a tap opens what can be done with it.- Box {- Box(- Modifier- .size(28.dp)- .clip(CircleShape)- .clickable { connectionMenu = true }- .padding(10.dp)- .clip(CircleShape)- .background(statusColor(model))- )- ConnectionMenu(model, expanded = connectionMenu, onDismiss = { connectionMenu = false }, onEditHost = onEditHost)- }// The desktop's sidebar: the projects and threads, as a sheet.IconButton(onClick = onTree, modifier = Modifier.size(36.dp)) {Icon(Icons.Outlined.ViewSidebar, contentDescription = tr("threads"), tint = Color.White, modifier = Modifier.size(20.dp))@@ -516,7 +500,7 @@ private fun TopBar(/// What the ⋯ menu used to hold about the host: reconnect or disconnect,/// and the host's editor.@Composable-private fun ConnectionMenu(model: TerminalModel, expanded: Boolean, onDismiss: () -> Unit, onEditHost: () -> Unit) {+fun ConnectionMenu(model: TerminalModel, expanded: Boolean, onDismiss: () -> Unit, onEditHost: () -> Unit) {DropdownMenu(expanded = expanded, onDismissRequest = onDismiss) {val connected = model.isConnectedText(@@ -718,7 +702,7 @@ private fun TabSubstrip(model: TerminalModel, onPinchOut: () -> Unit) {}}-private fun statusColor(model: TerminalModel): Color = when {+fun statusColor(model: TerminalModel): Color = when {model.reconnecting -> Color(0xFFFF9F0A)model.isConnected -> Color(0xFF34C759)model.connection.startsWith("connecting") || model.connection.contains("reconnect") -> Color(0xFFFF9F0A)diff --git a/android/app/src/main/java/com/roversx/thinkterm/TreeSheet.kt b/android/app/src/main/java/com/roversx/thinkterm/TreeSheet.ktindex c2c0ebdc..75ee3847 100644--- a/android/app/src/main/java/com/roversx/thinkterm/TreeSheet.kt+++ b/android/app/src/main/java/com/roversx/thinkterm/TreeSheet.kt@@ -87,13 +87,14 @@ import kotlinx.coroutines.delay/// threads under them, as far as the desktop's sidebar goes./// Everything is named as the desktop names it: thread, tab, pane.@Composable-fun TreeSheet(model: TerminalModel, onDismiss: () -> Unit) {+fun TreeSheet(model: TerminalModel, onDismiss: () -> Unit, onEditHost: () -> Unit) {val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)val open = remember { TreeOpen() }var spaceMenu by remember { mutableStateOf<List<MenuItem>>(emptyList()) }var spacesShown by remember { mutableStateOf(false) }var renaming by remember { mutableStateOf<Pair<String, String>?>(null) }var renameText by remember { mutableStateOf("") }+ var connectionMenu by remember { mutableStateOf(false) }val threads = model.threads?.threads ?: emptyList()val rows = model.sidebar?.rows ?: emptyList()val error = model.sidebar?.newProjectError@@ -152,6 +153,27 @@ fun TreeSheet(model: TerminalModel, onDismiss: () -> Unit) {Icon(Icons.Default.Add, contentDescription = tr("thread.new"))}}+ // The host this sheet belongs to: its state, and what can be done+ // with the connection (this used to be a dot in the bar).+ Box {+ Row(+ Modifier+ .fillMaxWidth()+ .clickable { connectionMenu = true }+ .padding(horizontal = 16.dp, vertical = 8.dp),+ verticalAlignment = Alignment.CenterVertically,+ horizontalArrangement = Arrangement.spacedBy(8.dp),+ ) {+ Box(Modifier.size(8.dp).background(statusColor(model), CircleShape))+ Text(model.host.display, style = MaterialTheme.typography.bodyMedium, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f))+ Text(+ if (model.isConnected) tr("disconnect") else tr("reconnect"),+ style = MaterialTheme.typography.labelMedium,+ color = MaterialTheme.colorScheme.primary,+ )+ }+ ConnectionMenu(model, expanded = connectionMenu, onDismiss = { connectionMenu = false }, onEditHost = onEditHost)+ }LazyColumn(Modifier.fillMaxWidth().weight(1f)) {items(rows) { row -> SideRowView(model, row, threads, open, onDismiss) }if (!error.isNullOrEmpty()) {diff --git a/ios/Sources/TerminalScreen.swift b/ios/Sources/TerminalScreen.swiftindex b7e1b55e..2b25218f 100644--- a/ios/Sources/TerminalScreen.swift+++ b/ios/Sources/TerminalScreen.swift@@ -160,7 +160,10 @@ struct TerminalScreen: View {}.ignoresSafeArea(.container, edges: .bottom).sheet(isPresented: $showTree) {- TreeSheet(model: model, isPresented: $showTree, menu: $menu)+ TreeSheet(model: model, isPresented: $showTree, menu: $menu, hostName: hostName, connected: connected, onEditHost: {+ showTree = false+ editingHost = model.host+ })}.sheet(isPresented: $showSettings) {NavigationStack {@@ -234,7 +237,7 @@ struct TerminalScreen: View {model.host?.display ?? tr("thismac")}- private var statusColor: Color {+ var statusColor: Color {if model.reconnecting { return .orange }if connected { return .green }if model.connection.hasPrefix("connecting") || model.connection.contains("reconnect") { return .orange }@@ -247,28 +250,8 @@ struct TerminalScreen: View {/// session state) shows its tabs in the bar instead.private var twoLevel: Bool { settings.tabBarLevels == "two" && !(model.threads?.threads.isEmpty ?? true) }- /// The dot is the connection: a tap opens what can be done with it.- private var connectionDot: some View {- Menu {- Section(hostName) {- Button(connected ? tr("disconnect") : tr("reconnect")) {- if connected { model.disconnect() } else { model.connect() }- }- if model.host != nil {- Button(tr("edithost")) { editingHost = model.host }- }- }- } label: {- Circle().fill(statusColor).frame(width: 7, height: 7)- .frame(width: 24, height: 24)- .contentShape(Rectangle())- }- .buttonStyle(.plain)- }-private var tabStrip: some View {HStack(spacing: 2) {- connectionDotScrollViewReader { reader inScrollView(.horizontal, showsIndicators: false) {HStack(spacing: 4) {diff --git a/ios/Sources/TreeSheet.swift b/ios/Sources/TreeSheet.swiftindex c77e76e3..92a540e1 100644--- a/ios/Sources/TreeSheet.swift+++ b/ios/Sources/TreeSheet.swift@@ -10,15 +10,44 @@ struct TreeSheet: View {@ObservedObject private var lang = AppLanguage.shared@Binding var isPresented: Bool@Binding var menu: MenuSheet?+ /// The host this sheet belongs to, and what can be done with its+ /// connection (this used to be a dot in the bar).+ var hostName: String = ""+ var connected: Bool = true+ var onEditHost: () -> Void = {}@State private var spaceMenu: [MenuItem] = []@State private var renaming: (kind: String, id: String)?@State private var renameText = ""private var threads: [ThreadView] { model.threads?.threads ?? [] }+ private var connectionColor: Color {+ if model.reconnecting { return .orange }+ if connected { return .green }+ if model.connection.hasPrefix("connecting") || model.connection.contains("reconnect") { return .orange }+ return .red+ }+var body: some View {NavigationStack {List {+ Section {+ Menu {+ Button(connected ? tr("disconnect") : tr("reconnect")) {+ if connected { model.disconnect() } else { model.connect() }+ }+ if model.host != nil {+ Button(tr("edithost")) { onEditHost() }+ }+ } label: {+ HStack(spacing: 8) {+ Circle().fill(connectionColor).frame(width: 8, height: 8)+ Text(hostName).lineLimit(1)+ Spacer()+ Text(connected ? tr("disconnect") : tr("reconnect")).font(.subheadline).foregroundColor(.accentColor)+ }+ }+ }ForEach(model.sidebar?.rows ?? []) { row inrowView(row)}