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: the sidebar ends at threads, as the desktop's does
RoversX3c297b0606f5
diff --git a/android/app/src/main/java/com/roversx/thinkterm/TreeSheet.kt b/android/app/src/main/java/com/roversx/thinkterm/TreeSheet.ktindex 7f659806..c2c0ebdc 100644--- a/android/app/src/main/java/com/roversx/thinkterm/TreeSheet.kt+++ b/android/app/src/main/java/com/roversx/thinkterm/TreeSheet.kt@@ -84,7 +84,7 @@ import kotlinx.coroutines.delay/// The desktop's sidebar and tab strip in one sheet, the way both are on/// screen at once there: the Space, its threads by project, under an-/// opened thread its tabs, and under a tab with several panes, its panes.+/// threads under them, as far as the desktop's sidebar goes./// Everything is named as the desktop names it: thread, tab, pane.@Composablefun TreeSheet(model: TerminalModel, onDismiss: () -> Unit) {@@ -358,7 +358,6 @@ private fun ThreadRows() {val accent = MaterialTheme.colorScheme.primaryval secondary = MaterialTheme.colorScheme.onSurfaceVariant- val opened = open.threads.contains(thread.id)var menu by remember { mutableStateOf(false) }Column {Box {@@ -388,133 +387,12 @@ private fun ThreadRows(if (thread.pinned) {Icon(Icons.Default.PushPin, contentDescription = null, tint = secondary, modifier = Modifier.size(14.dp))}- Text(- if (thread.live) tr(if (thread.tabs.size == 1) "tab.one" else "tab.n", thread.tabs.size) else tr("thread.off"),- style = MaterialTheme.typography.labelSmall,- color = secondary,- )- if (thread.tabs.isNotEmpty()) {- IconButton(onClick = { open.toggleThread(thread.id) }, modifier = Modifier.size(28.dp)) {- Icon(- Icons.Default.KeyboardArrowDown,- contentDescription = null,- tint = secondary,- modifier = Modifier.size(18.dp).rotate(if (opened) 0f else -90f),- )- }+ if (!thread.live) {+ Text(tr("thread.off"), style = MaterialTheme.typography.labelSmall, color = secondary)}}AppContextMenu(model = model, kind = "thread", id = thread.id, expanded = menu, onDismiss = { menu = false })}- if (opened) {- for (tab in thread.tabs) TabRows(model, thread, tab, indent + 20.dp, open, onDismiss)- }- }-}--/// A tab, and when open, its panes.-@Composable-private fun TabRows(- model: TerminalModel,- thread: ThreadView,- tab: ThreadTab,- indent: Dp,- open: TreeOpen,- onDismiss: () -> Unit,-) {- val accent = MaterialTheme.colorScheme.primary- val secondary = MaterialTheme.colorScheme.onSurfaceVariant- val key = thread.id + ":" + tab.tab- val opened = open.tabs.contains(key)- val current = thread.current && tab.current- var menu by remember { mutableStateOf(false) }- Box {- Row(- Modifier- .fillMaxWidth()- .combinedClickable(- onClick = {- model.chromeClick("pane", pane = tab.target)- onDismiss()- },- onLongClick = { menu = true },- )- .padding(start = 16.dp + indent, end = 8.dp, top = 5.dp, bottom = 5.dp),- verticalAlignment = Alignment.CenterVertically,- horizontalArrangement = Arrangement.spacedBy(8.dp),- ) {- Icon(- Icons.Default.Terminal,- contentDescription = null,- tint = if (current) accent else secondary,- modifier = Modifier.size(16.dp),- )- Row(- Modifier.weight(1f),- verticalAlignment = Alignment.CenterVertically,- horizontalArrangement = Arrangement.spacedBy(6.dp),- ) {- Text(- tab.title.ifEmpty { tr("tab.num", tab.tab) },- style = MaterialTheme.typography.bodyMedium,- maxLines = 1,- overflow = TextOverflow.Ellipsis,- )- val first = tab.panes.firstOrNull()- if (first != null && first.title.isNotEmpty() && first.title != tab.title) {- Text(- first.title,- style = MaterialTheme.typography.labelSmall,- color = secondary,- maxLines = 1,- overflow = TextOverflow.Ellipsis,- )- }- }- if (current) {- Icon(Icons.Default.Check, contentDescription = null, tint = accent, modifier = Modifier.size(16.dp))- }- if (tab.panes.size > 1) {- Text(tr("panes.n", tab.panes.size), style = MaterialTheme.typography.labelSmall, color = secondary)- IconButton(onClick = { open.toggleTab(key) }, modifier = Modifier.size(28.dp)) {- Icon(- Icons.Default.KeyboardArrowDown,- contentDescription = null,- tint = secondary,- modifier = Modifier.size(18.dp).rotate(if (opened) 0f else -90f),- )- }- }- }- AppContextMenu(model = model, kind = "tab", id = tab.tab.toString(), expanded = menu, onDismiss = { menu = false })- }- if (opened) {- val focused = model.tabs?.current?.panes?.firstOrNull { it.current }?.pane- for (pane in tab.panes) {- Row(- Modifier- .fillMaxWidth()- .clickable {- model.chromeClick("pane", pane = pane.pane)- onDismiss()- }- .padding(start = 16.dp + indent + 22.dp, end = 16.dp, top = 5.dp, bottom = 5.dp),- verticalAlignment = Alignment.CenterVertically,- horizontalArrangement = Arrangement.spacedBy(8.dp),- ) {- Box(Modifier.size(6.dp).background(secondary, RoundedCornerShape(1.dp)))- Text(- pane.title.ifEmpty { "shell" },- style = MaterialTheme.typography.bodyMedium,- maxLines = 1,- overflow = TextOverflow.Ellipsis,- modifier = Modifier.weight(1f),- )- if (thread.current && focused == pane.pane) {- Icon(Icons.Default.Check, contentDescription = null, tint = accent, modifier = Modifier.size(16.dp))- }- }- }}}diff --git a/ios/Resources/strings.json b/ios/Resources/strings.jsonindex 1ee860ac..72d13472 100644--- a/ios/Resources/strings.json+++ b/ios/Resources/strings.json@@ -942,7 +942,7 @@"language": "语言","m.overview": "总览…","m.settings": "设置…",- "m.threadstabs": "线程与标签…",+ "m.threadstabs": "会话与标签…","more": "更多…","newhost": "新建主机","newtab": "新建标签",@@ -953,8 +953,8 @@"optional": "可选","otherwindows": "其他窗口","overview": "实时总览",- "overview.empty": "没有活动的线程",- "overview.none": "这台服务器上没有线程。",+ "overview.empty": "没有活动的会话",+ "overview.none": "这台服务器上没有会话。","p.colors": "配色","p.customize": "自定义","p.history": "历史",@@ -1022,8 +1022,8 @@"thread.delete.title": "删除“%@”?","thread.new": "新建会话","thread.off": "已关",- "threads": "线程",- "threadstabs": "线程与标签",+ "threads": "会话",+ "threadstabs": "会话与标签","version": "版本","window.n": "窗口 %d","workspaces": "工作区",diff --git a/ios/Sources/TreeSheet.swift b/ios/Sources/TreeSheet.swiftindex 6ae50085..c77e76e3 100644--- a/ios/Sources/TreeSheet.swift+++ b/ios/Sources/TreeSheet.swift@@ -2,7 +2,7 @@ import SwiftUI/// The desktop's sidebar and tab strip in one list, the way both are on/// screen at once on the desktop: the Space, its pinned threads, its-/// projects with their threads, and under an opened thread its tabs, and+/// projects with their threads, as far as the desktop's sidebar goes;/// under a tab with several panes, its panes. Everything is named as the/// desktop names it: thread, tab, pane.struct TreeSheet: View {@@ -10,8 +10,6 @@ struct TreeSheet: View {@ObservedObject private var lang = AppLanguage.shared@Binding var isPresented: Bool@Binding var menu: MenuSheet?- @State private var openThreads: Set<String> = []- @State private var openTabs: Set<String> = []@State private var spaceMenu: [MenuItem] = []@State private var renaming: (kind: String, id: String)?@State private var renameText = ""@@ -66,10 +64,6 @@ struct TreeSheet: View {.onAppear {model.refreshViews()reloadSpaces()- // The current thread starts open: its tabs are what the strip shows.- if let current = threads.first(where: { $0.current }) {- openThreads.insert(current.id)- }}.onChange(of: model.sidebar?.editing) { _, editing inguard let editing, editing.kind != "none", let id = editing.id else { return }@@ -155,7 +149,6 @@ struct TreeSheet: View {/// A thread, and when open, its tabs under it.@ViewBuilderprivate func threadRows(_ thread: ThreadView, indent: CGFloat) -> some View {- let open = openThreads.contains(thread.id)HStack(spacing: 8) {Circle().fill(TerminalScreen.threadColor(status: thread.status, live: thread.live)).frame(width: 8, height: 8)Button {@@ -170,19 +163,8 @@ struct TreeSheet: View {if thread.pinned {Image(systemName: "pin").font(.caption).foregroundColor(.secondary)}- Text(thread.live ? tr(thread.tabs.count == 1 ? "tab.one" : "tab.n", thread.tabs.count) : tr("thread.off"))- .font(.caption2).foregroundColor(.secondary)- if !thread.tabs.isEmpty {- Button {- if open { openThreads.remove(thread.id) } else { openThreads.insert(thread.id) }- } label: {- Image(systemName: "chevron.down")- .rotationEffect(.degrees(open ? 0 : -90))- .font(.caption)- .foregroundColor(.secondary)- .frame(width: 24, height: 24)- }- .buttonStyle(.plain)+ if !thread.live {+ Text(tr("thread.off")).font(.caption2).foregroundColor(.secondary)}}.padding(.leading, indent)@@ -190,75 +172,8 @@ struct TreeSheet: View {.contextMenu {AppMenuItems(model: model, kind: "thread", id: thread.id)}- if open {- ForEach(thread.tabs) { tab in- tabRows(thread, tab, indent: indent + 20)- }- }}- /// A tab, and when open, its panes.- @ViewBuilder- private func tabRows(_ thread: ThreadView, _ tab: ThreadTab, indent: CGFloat) -> some View {- let key = thread.id + ":" + String(tab.tab)- let open = openTabs.contains(key)- let current = thread.current && tab.current- HStack(spacing: 8) {- Image(systemName: "terminal").foregroundColor(current ? .accentColor : .secondary)- Button {- model.chromeClick("pane", pane: tab.target)- isPresented = false- } label: {- HStack(spacing: 6) {- Text(tab.title.isEmpty ? tr("tab.num", tab.tab) : tab.title)- if let first = tab.panes.first, !first.title.isEmpty, first.title != tab.title {- Text(first.title).font(.caption).foregroundColor(.secondary)- }- }- .frame(maxWidth: .infinity, alignment: .leading)- }- .buttonStyle(.plain)- if current {- Image(systemName: "checkmark").foregroundColor(.accentColor)- }- if tab.panes.count > 1 {- Text(tr("panes.n", tab.panes.count)).font(.caption2).foregroundColor(.secondary)- Button {- if open { openTabs.remove(key) } else { openTabs.insert(key) }- } label: {- Image(systemName: "chevron.down")- .rotationEffect(.degrees(open ? 0 : -90))- .font(.caption)- .foregroundColor(.secondary)- .frame(width: 24, height: 24)- }- .buttonStyle(.plain)- }- }- .padding(.leading, indent)- .contextMenu {- AppMenuItems(model: model, kind: "tab", id: String(tab.tab))- }- if open {- ForEach(tab.panes) { pane in- Button {- model.chromeClick("pane", pane: pane.pane)- isPresented = false- } label: {- HStack(spacing: 8) {- RoundedRectangle(cornerRadius: 1).fill(Color.secondary).frame(width: 6, height: 6)- Text(pane.title.isEmpty ? "shell" : pane.title).font(.subheadline)- Spacer()- if thread.current, model.tabs?.tabs.first(where: { $0.current })?.panes.first(where: { $0.current })?.pane == pane.pane {- Image(systemName: "checkmark").foregroundColor(.accentColor)- }- }- }- .buttonStyle(.plain)- .padding(.leading, indent + 22)- }- }- }}/// The desktop's Live Overview as an overlay under the terminal: a card