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: five more findings of the review
RoversX52cd612d79c8
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xmlindex bdb1cfa0..aa04ddce 100644--- a/android/app/src/main/AndroidManifest.xml+++ b/android/app/src/main/AndroidManifest.xml@@ -16,7 +16,7 @@android:name=".MainActivity"android:exported="true"android:windowSoftInputMode="adjustResize"- android:configChanges="orientation|screenSize|keyboardHidden">+ android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|keyboardHidden|keyboard|uiMode|density|fontScale|locale|layoutDirection"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" />diff --git a/android/app/src/main/java/com/roversx/thinkterm/HostEditScreen.kt b/android/app/src/main/java/com/roversx/thinkterm/HostEditScreen.ktindex e8b7775b..f63b3fd7 100644--- a/android/app/src/main/java/com/roversx/thinkterm/HostEditScreen.kt+++ b/android/app/src/main/java/com/roversx/thinkterm/HostEditScreen.kt@@ -137,7 +137,8 @@ fun HostEditScreen(}}- val canSave = draft.hostname.isNotBlank() && draft.user.isNotBlank() &&+ val portOk = portText.isEmpty() || portText.toIntOrNull()?.let { it in 1..65535 } == true+ val canSave = draft.hostname.isNotBlank() && draft.user.isNotBlank() && portOk &&(isExisting || hasStoredSecret || secret.isNotEmpty())Scaffold(@@ -181,7 +182,9 @@ fun HostEditScreen() { draft = draft.copy(hostname = it.trim()) }EditField(tr("f.port"), portText, placeholder = "22", keyboard = KeyboardType.Number) { typed ->portText = typed.filter { it.isDigit() }.take(5)- draft = draft.copy(port = portText.toIntOrNull() ?: 22)+ // Out of range is kept in the field (and blocks Save)+ // rather than silently becoming another port.+ draft = draft.copy(port = portText.toIntOrNull()?.takeIf { it in 1..65535 } ?: 22)}EditField(tr("f.user"), draft.user, placeholder = "root") { draft = draft.copy(user = it.trim()) }}diff --git a/android/app/src/main/java/com/roversx/thinkterm/HostStore.kt b/android/app/src/main/java/com/roversx/thinkterm/HostStore.ktindex 591d33fd..b8a9f7fa 100644--- a/android/app/src/main/java/com/roversx/thinkterm/HostStore.kt+++ b/android/app/src/main/java/com/roversx/thinkterm/HostStore.kt@@ -80,7 +80,11 @@ class HostStore(context: Context) {fun upsert(host: Host) {val at = hosts.indexOfFirst { it.id == host.id }- hosts = if (at >= 0) hosts.toMutableList().also { it[at] = host } else hosts + host+ // Another address is another machine as far as its key goes: the+ // pin stays only while the host is where it was pinned.+ val moved = at >= 0 && (hosts[at].hostname != host.hostname || hosts[at].port != host.port)+ val next = if (moved) host.copy(knownHost = null) else host+ hosts = if (at >= 0) hosts.toMutableList().also { it[at] = next } else hosts + nextsave()}diff --git a/android/app/src/main/java/com/roversx/thinkterm/Sidebar.kt b/android/app/src/main/java/com/roversx/thinkterm/Sidebar.ktindex f59b0cfd..ab7ebb82 100644--- a/android/app/src/main/java/com/roversx/thinkterm/Sidebar.kt+++ b/android/app/src/main/java/com/roversx/thinkterm/Sidebar.kt@@ -97,7 +97,9 @@ private class Folded(model: TerminalModel) {private fun SidebarTree(model: TerminalModel, onDismiss: () -> Unit, onEditHost: () -> Unit, onSettings: () -> Unit) {val folded = remember(model) { Folded(model) }var connectionMenu by remember { mutableStateOf(false) }- var spaceMenu by remember { mutableStateOf(false) }+ /// The Space whose menu is up, if any: one flag for all of them+ /// would open every Space's menu at once.+ var spaceMenuFor by remember { mutableStateOf<String?>(null) }var renaming by remember { mutableStateOf<Pair<String, String>?>(null) }var renameText by remember { mutableStateOf("") }val tree = model.tree@@ -174,7 +176,7 @@ private fun SidebarTree(model: TerminalModel, onDismiss: () -> Unit, onEditHost:if (!space.current) model.setSpace(space.id)if (spaceKey in folded) folded.toggle(spaceKey)},- onLongClick = { spaceMenu = true },+ onLongClick = { spaceMenuFor = space.id },trailing = {IconButton(onClick = { model.setSpace(space.id); model.sideClick("new-project") }, modifier = Modifier.size(32.dp)) {Icon(Icons.Default.Add, contentDescription = tr("project.new"), tint = secondary, modifier = Modifier.size(16.dp))@@ -183,7 +185,7 @@ private fun SidebarTree(model: TerminalModel, onDismiss: () -> Unit, onEditHost:) {Text(space.name, fontWeight = if (space.current) FontWeight.SemiBold else FontWeight.Normal, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f))}- AppContextMenu(model, "space", "", expanded = spaceMenu, onDismiss = { spaceMenu = false })+ AppContextMenu(model, "space", "", expanded = spaceMenuFor == space.id, onDismiss = { spaceMenuFor = null })}}if (spaceKey in folded) continuediff --git a/android/app/src/main/java/com/roversx/thinkterm/TerminalModel.kt b/android/app/src/main/java/com/roversx/thinkterm/TerminalModel.ktindex d8a335ff..494041d4 100644--- a/android/app/src/main/java/com/roversx/thinkterm/TerminalModel.kt+++ b/android/app/src/main/java/com/roversx/thinkterm/TerminalModel.kt@@ -197,7 +197,7 @@ class TerminalModel(log("shell: connecting ${h.address}, ${secret.length} chars of secret")core.connect(host = h.hostname,- port = h.port.toUShort(),+ port = h.port.coerceIn(1, 65535).toUShort(),user = h.user,authKind = h.auth,secret = secret,diff --git a/ios/Sources/HostEditView.swift b/ios/Sources/HostEditView.swiftindex c133b70d..5ae8b9ac 100644--- a/ios/Sources/HostEditView.swift+++ b/ios/Sources/HostEditView.swift@@ -238,6 +238,7 @@ struct HostEditView: View {private var canSave: Bool {guard !host.hostname.trimmingCharacters(in: .whitespaces).isEmpty,!host.user.trimmingCharacters(in: .whitespaces).isEmpty else { return false }+ guard (1...65535).contains(host.port) else { return false }// A new host has nothing in the Keychain yet, so it needs a secret now.return isExisting || hasStoredSecret || !secret.isEmpty}diff --git a/ios/Sources/Models.swift b/ios/Sources/Models.swiftindex 55008cb8..3eaebcd0 100644--- a/ios/Sources/Models.swift+++ b/ios/Sources/Models.swift@@ -81,7 +81,13 @@ final class HostStore: ObservableObject {}func upsert(_ host: Host) {+ var host = hostif let i = hosts.firstIndex(where: { $0.id == host.id }) {+ // Another address is another machine as far as its key goes:+ // the pin stays only while the host is where it was pinned.+ if hosts[i].hostname != host.hostname || hosts[i].port != host.port {+ host.knownHost = nil+ }hosts[i] = host} else {hosts.append(host)diff --git a/thinkterm-mobile/src/core.rs b/thinkterm-mobile/src/core.rsindex 567a2c22..21876312 100644--- a/thinkterm-mobile/src/core.rs+++ b/thinkterm-mobile/src/core.rs@@ -856,15 +856,20 @@ impl State {return;}};- let (Some(link), Some(fonts), Some(glyph_platform), Some(gpu)) = (+ // The GPU state is taken only once the rest is known to be there:+ // taken inside a pattern that then fails to match, it would be+ // dropped with the match, and the target left over it would draw+ // on nothing.+ let (Some(link), Some(fonts), Some(glyph_platform), true) = (self.link.clone(),self.fonts.clone(),self.glyph_platform.clone(),- self.gpu.take(),+ self.gpu.is_some(),) else {self.fail("attached without a link, fonts or a GPU".into());return;};+ let gpu = self.gpu.take().expect("checked just above");let scale = self.target.as_ref().map(|t| t.scale).unwrap_or(1.0);let dpi = (self.platform.units_per_inch() * scale) as u32;let side = 1024u32.min(gpu.max_texture_dimension());