Skip to content

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.

android: the landed terminal is hidden, not just faded

RoversX1d5623e2de21
diff --git a/android/app/src/main/java/com/roversx/thinkterm/TerminalScreen.kt b/android/app/src/main/java/com/roversx/thinkterm/TerminalScreen.kt
index a86ea094..6e53f13e 100644
--- a/android/app/src/main/java/com/roversx/thinkterm/TerminalScreen.kt
+++ b/android/app/src/main/java/com/roversx/thinkterm/TerminalScreen.kt
@@ -10,6 +10,7 @@ import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.gestures.detectDragGestures
+import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.gestures.detectTransformGestures
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Arrangement
@@ -177,6 +178,7 @@ fun TerminalScreen(host: Host, store: HostStore, onBack: () -> Unit) {
if (!overviewShown) return
scope.launch {
livePreview = false
+ hostView?.visibility = android.view.View.VISIBLE
fade.animateTo(0f, tween(150))
zoom.animateTo(0f, spring(dampingRatio = 0.9f, stiffness = 400f))
overviewShown = false
@@ -211,6 +213,10 @@ fun TerminalScreen(host: Host, store: HostStore, onBack: () -> Unit) {
zoom.animateTo(1f, spring(dampingRatio = 0.85f, stiffness = 300f))
if (overviewShown) {
fade.animateTo(1f, tween(180))
+ // A faded layer is not enough: the texture repaints itself on
+ // every new frame (the cursor's blink) and can show through
+ // for one; hidden outright, it cannot.
+ hostView?.visibility = android.view.View.INVISIBLE
livePreview = overviewShown
}
}
@@ -275,6 +281,9 @@ fun TerminalScreen(host: Host, store: HostStore, onBack: () -> Unit) {
.fillMaxWidth()
.weight(1f)
.onGloballyPositioned { if (!overviewShown) terminalBounds = it.boundsInRoot() }
+ // In the overview the shrunken terminal is the live card:
+ // a tap on it (the hidden view lets it through) closes.
+ .then(if (overviewOpen) Modifier.pointerInput(Unit) { detectTapGestures { closeOverview() } } else Modifier)
.graphicsLayer {
val t = zoom.value
val target = zoomTarget
diff --git a/android/app/src/main/java/com/roversx/thinkterm/TerminalView.kt b/android/app/src/main/java/com/roversx/thinkterm/TerminalView.kt
index cb4c5413..eda40a51 100644
--- a/android/app/src/main/java/com/roversx/thinkterm/TerminalView.kt
+++ b/android/app/src/main/java/com/roversx/thinkterm/TerminalView.kt
@@ -39,7 +39,9 @@ class TerminalHostView(context: Context, private val model: TerminalModel) : Fra
private var lastSize = Triple(0, 0, 0.0)
init {
- texture.isOpaque = true
+ // Not opaque: the overview fades the terminal, and an opaque texture
+ // ignores its layer's alpha when it repaints itself.
+ texture.isOpaque = false
addView(texture, LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT))
addView(input, LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT))
model.onFocusRequested = { input.focusAndShowKeyboard() }