Repository navigation
Conversation
Move the engine-backed terminal screen, its chrome and its state out of :app and :ui into a dedicated :features:terminal module. Keep the JNI bridge classes in :terminal at their existing FQNs and localise the terminal strings with the feature. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
Rename implementation classes after the storage or adapter they actually use, give every feature module the same package prefix, split the top bar and terminal host chrome, and localise the selection toolbar. Remove the unused top-bar selection menu, the manager's duplicate selection state, and the renderer-side bounds publication that nothing consumed. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
Keep the agent chat, settings, attachments and SSH host screens beside the features that own them instead of in :ui. Shared presentation pieces (the agent buttons, code palette, markdown theme and clipboard helper) stay in :ui because the backup, session and theme surfaces use them too. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
The moved agent screens still used same-package modifiers and code-block rendering that the theme and session surfaces also need. Keep those in :ui so the feature module does not recreate them, and drop the stale same-package imports left behind by the move. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
The agent screens moved out of :ui but still read the settings group gap, the code-block corner and the shared motion duration. Make those tokens public and import them from :ui instead of the old same-package paths. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
Move the terminal setup and pane bodies out of TerminalScreen, split the ready screen from the entry point, and separate the agent chat's model picker and transcript renderers. The settings categories now live in their own files, and the floating split pane no longer shares SplitPaneHost's file. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
Move the provider picker, session log controls and backup step labels into their own files so the screens that compose them stay readable. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
Shape adjacent operator cells as one run so the font's calt/liga tables produce real programming ligatures, with the setting wired through the surface and renderer. Replace glClear with a full-screen triangle pass as Ghostty does, and pace presentation to a 120 Hz budget while still draining input and commands on every wake. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
Keep the model picker's KDoc and experimental opt-in with the picker, and move the transcript docs to the files that now own those functions. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
The pane body now lives in its own file and still reads the session transition constant from the screen's file. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
Cells.buildSprites now reports how many cells a sprite consumes so a ligature can span several; the test writer still answered Boolean and broke the test compile. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
A shaped run replaces the cells it spans with a single sprite, so the row walker has to skip that many columns; a run ending at the row's last column must stop there rather than write sprites a later row would own. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Taps, drags and wheels for a tracking program carry their own state — a held button, a locked wheel axis, a sub-cell remainder — and the surface only has to say whether the program asked for them. Keeping that state next to the encoding that uses it leaves the view with gestures and drawing. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Ligatures, the single background triangle and the frame pacing are all in the code now, and both documents still said they were not. docs/STATUS.md also points at the branch the snapshot was taken on. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The engine's buffer APIs report GHOSTTY_OUT_OF_SPACE (-3) from the measuring call — a null buffer with the required size written back — and treating that as a failure rejected every selection copy before the text was ever written. Recognise the constant and let the sized call run.
The reader thread reads while the main thread writes and resizes, and the JNI entries all reached the same Pty through separate `&mut`/`&` raw pointers — a data race the compiler cannot see across the boundary. A handle is now a `Box<Mutex<Pty>>` and every entry point takes the lock; a read holds it until the bytes have left the PTY's scratch. The child now starts from a clean slate, matching Ghostty's childPreExec: the standard signal dispositions are reset to SIG_DFL and the signal mask is cleared before exec, so the JVM's ignored SIGPIPE and its handlers do not leak into the guest. The master is marked close-on-exec and put in IUTF8 mode, both best-effort. The PTY also answers the facts a session needs: the foreground process group (tcgetpgrp), the slave name (ptsname_r), the local modes (ICANON/ECHO) and the kernel's current size, exposed as four new JNI entry points for the Kotlin wrappers that follow.
The native side now answers the foreground process group, the slave name, the local modes and the kernel's size; this is the Kotlin surface for them. The foreground group is the signal a session uses to know a command is running without the shell having to report anything.
The foreground notification was a static session count. It now carries the state a terminal user needs at a glance and the actions Termux's own notification offers: a New session button, a wake/wifi-lock toggle whose label and icon are its state, and Exit. The text adds the running-command and wake-lock markers, and the posting is only alert-once, silent and ongoing. The wake lock is a PARTIAL_WAKE_LOCK plus a WIFI_MODE_FULL_HIGH_PERF WifiLock, taken and released together with no timeout, released in onDestroy, and paired with the system's battery-optimisation dialog so a held lock actually survives doze. One TerminalWakeLock owns it. Every input to the notification routes through one refresh path, so the builder is the only definition of what it says, and the channel is created in exactly one place — shared with SetupForegroundService, which posted on the same channel and defined it a second time.
The reader loop read non-blockingly and, on an empty read, waited 8 ms and re-checked — a busy wakeup, and the child's exit was only noticed on the next tick. It now waits on the kernel with poll(POLLIN): the thread sleeps until the child writes or closes its side, so an idle terminal stops waking twenty-five times a second and a hangup is seen at once. The wait must not hold the PTY's lock, or a write from the main thread would queue behind it, so the JNI entry copies the master fd under the lock and polls it outside. The fd is stable for the PTY's life, so the copy is safe.
Termio's model: one thread owns the PTY. Input writes and resizes are now queued to the reader thread and the reader is poked through a wake pipe, so the two never reach the PTY at once and a write does not wait out the poll. The pipe is made per session, close-on-exec and non-blocking; when it cannot be made the session falls back to writing straight through, so input is never stuck behind the wait. The pty lock stays as the safety net for the bridged and fallback paths. The same kernel source answers what is in the foreground: tcgetpgrp gives the terminal's foreground process group, whose leader's name is read from /proc/<pgid>/comm. The process sheet reports it as a job when it is not the shell itself, so a session says what it is running without the shell having to opt into OSC 133.
Routing writes through the reader thread made a large paste able to deadlock it: the all-bytes write spins while the terminal's input buffer is full, and the thread that would have drained the child's output — which is what frees that buffer — was the one spinning. Input is now written with a bounded, non-blocking call; a short write leaves the tail queued and the reader waits on writability with POLLOUT, so it always comes back to the child's output.
The one-crossing key and mouse paths cast the pty handle straight to `*mut Pty`, but the handle is a `Mutex<Pty>`: the write read the mutex's header as the terminal's fields and sent the bytes to whatever descriptor fell out. Text from the IME still arrived through the locked path, so typing looked fine while Enter — which only travels as a key event — never reached the child. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The run scan derived the row's base and then re-added `column - column`, so every run was read from the row's first cell. A prompt containing a trigger pair (the `:~` in `root@host:~#`) therefore shaped the prompt itself and drew it again at the column being typed, leaving a second prompt beside the first. The scan moves into LigaturePolicy.runLength, whose signature is the run's own start, and two tests hold that contract. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The grip was a 10 dp circle on a 4.4 dp stem, which read as a blob sitting on the character being adjusted. The knob is now 5.6 dp with a 2 dp stem that spans the endpoint's own row, and it sits just outside the selection with its inner edge on the line the stem ends at, so the text under it stays readable. The 44 dp touch target is unchanged and stays centred on the endpoint. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The terminal's face was one bundled TTF and a picker that stored a URI nothing ever read. It is now a shelf: Nerd Font builds (family plus the prompt's private-use glyphs) fetched from the pinned nerd-fonts release, downloaded into the app's own directory, and chosen from a store screen. The active face is written as a setting and as a marker beside it, because the renderer runs on a draw thread and cannot read a TOML document to find out what to rasterise with. Also adds the two settings the model had and the screen never showed — the bell and the background image switch — and fixes the status bar coming back for the screens that are not the terminal, backup and restore included. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The command was handed to the guest as the shell's `-c` argument, which runs it and exits: a user who set it got a session that closed behind the output. It is now appended to the shell integration's rc script, so it runs with the user's own aliases and prompt behind it and the interactive shell carries on. The greeting is off by default: a card in front of the prompt, on every new session, for a message nobody had written yet. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The updates screen was a developer's column: white text on the app's background, English literals, buttons per row and no way back from the top. It is now a settings category like the others — a channel segment, a check row, and one tile per component with what is installed, what the channel offers and the single action that applies. The screen itself lives in :ui and takes plain strings, so the engine types stay in the app module that owns the view model. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The background lived at the bottom of Appearance, under the theme and the fonts, where it read as a fourth kind of colour. It is not: the theme decides what the terminal draws, and this decides what is behind it. The rows move to their own screen, the home list gains the row that opens it, and the two one-row groups at the bottom (an English heading, then About) become one group of the app's own half. The home groups also stop carrying Turkish and English literals: backup and version management have strings like every other row. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Both settings were wired to nothing: `boldBrightens` was copied into a field and never read, and the dim parameter reached a pane that ignored it, beside a colour constant no one used. Bold now brightens by giving the engine's bright palette slots the normal colours when the switch is off, and the unfocused half of a split is dimmed by an overlay drawn by the pane that already knows the answer. Ligatures were already live; the other two were decoration. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The cell was the font's own line box and nothing else, so the one typographic knob a terminal has that is not the size did not exist. It is now a setting: the cell's height is the line box times a multiplier, clamped by the screen as well as by the file, and the renderer's existing centring puts the glyph in the middle of the taller row rather than at its top. Width is untouched — a monospace cell is its advance — so the setting trades rows for air and changes nothing about where a column lands. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
…screen The engine has had a scrollback limit in its ABI all along; the app never set it, so a long `cat` pruned history at the library's ten-thousand-*byte* default. A setting now names the limit in lines, applied at session start and again whenever it changes, because lowering it prunes immediately. The keyboard had exactly one way in: a tap anywhere, which is also how a terminal is read. There are four now — tap, two-finger tap, bottom edge, and never — each a gesture the terminal was not using. A pinch claims the scale detector the moment the fingers move, so a still two-finger tap cannot become a zoom. And the categories are rebuilt: Appearance, Background and Language were three screens behind three rows, while half the terminal's own settings lived at the bottom of Appearance. General is one screen; Terminal is the terminal's, with the typography and history rows that used to be elsewhere. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The table a colour number resolves through was a private member of a 2,800-line class, which meant nothing could test it — including the one rule the app owns: that turning bold-brightening off leaves the bright slots equal to the normal ones. It is a pure function of the theme and a flag now, in its own file, with tests for the ANSI slots, the colour cube, the grey ramp and the flag itself. The manager keeps the settings flow and the calls into the engine. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
…retched The scrollback option constants were hand-re-exported in the native crate's ghostty module and I had used them without adding them there, so the native build failed on both ABIs. They are exported now, next to the kitty limit. Three gesture and rendering bugs from the same pass: - Android's "quick scale" is a double tap followed by a drag and reports through the scale detector, so a double tap on a terminal dragged the font size. It is off, the detector engages only on two fingers, and the chrome only follows a zoom that crossed the dead zone. - Fingers after a pinch no longer scroll or select: a zoom ends when one finger lifts, not when the last one does. - Emoji were drawn into a two-cell box regardless of their aspect, which squashed them horizontally; wide CJK glyphs sat hard against the left edge of their pair. Both are centred in their cells at their own size now. A drag whose shift changes but whose rows do not asks for a full redraw: a sub-row shift moves every row, and the engine marks no row dirty for it. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
AAPT rejects an unescaped quote inside a string, and the whole resource merge fails with it, so the debug build could not be assembled. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The settings reorganisation renamed AppearanceCategory to GeneralCategory and the import in MainActivity was left behind, so `:app:compileDebugKotlin` failed and both the APK and the unit-test workflows went red with it. The shadowed `TerminalMode.Companion.fromToml` extension went too: the member already exists and the extension could never be called. CI, from the timings of the last run (native 48s, APK 3m, tests 5m): - The unit tests were four Gradle invocations — the boundary check, :domain, :features:agent and everything else — each paying for a JVM and the full configuration. They are one build now, in parallel. - `--max-workers=2` left half of the runner's cores idle while Kotlin compiled the feature modules. Both Android builds use all four. - The debug APK's native job restores the library from a cache keyed on the Rust sources, the engine script and the NDK version, so a change that only touched Kotlin no longer re-runs the toolchain and the compile. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The library was built in four places — the Native gate, the debug APK, the nightly and the release — each with its own copy of the NDK download, the libclang workaround, the engine fetch and the link check. They had already drifted: only one of them checked the engine's SONAME. `native-build.yml` is now the single recipe, called with the ABI and an artifact name. It uploads both libraries already laid out as jniLibs, so the callers unpack one artifact instead of fetching the engine and staging it. Build Debug also loses two steps: the selection tests it ran with a `--tests` filter are part of the `test` task the Unit Tests workflow already runs, and re-running them here paid for a second JVM and a second full configuration. Every Android build now uses all four runners' cores, and the nightly and release builds run Gradle in parallel too. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The Rust and engine libraries were a reusable file that only ran when another workflow called it, so the "Native" gate was a job inside the build it was meant to be independent of. It is now native.yml: its own push and pull-request triggers for the native paths, plus workflow_call for Build Debug, Nightly and Release. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
… as the text Scroll: a drag no longer resets the sub-row shift at the touch, so the picture does not jump a row the instant a gesture starts; the edge is reached by the machine's own clamp, with no correction to spring back from, and a gesture that ends off a row settles once, at the lift. Emoji: the atlas rasterises the glyph into exactly the cells it covers and the quad draws those cells, so an emoji is the height of the text beside it, is never squashed sideways, and each one stays inside its own cell. Selection: the highlight is the cell's own two colours swapped, so it carries the letter's colour instead of flattening it to the theme's foreground. The box and the grips now follow the sub-row shift down instead of up, which is what slid the menu and the handles a row per row of scroll. The grips are amber, have no ring, glide on a spring, and the bottom one hangs off the end of the selected cell. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
…e cancelling itself The 6x6x6 cube and the grey ramp were built without their alpha byte, so every colour above 15 was fully transparent — one unit test caught it and should have failed the build for weeks. The engine palette now writes 0xFF for both ranges. native.yml's concurrency group was keyed by the ref, which put the standalone Native run and the copy Build Debug calls in the same group: the two cancelled each other and one build reported a failure for it. Keyed by the workflow as well, they no longer meet. The NDK download is retried instead of failing a whole build on a mirror hiccup. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
…que colours Native.yml lost the NDK_VERSION job variable when it became a workflow of its own: the install step ran with `set -u` and died on the unbound name, which failed every build that needs the native libraries. The palette's cube and ramp are ARGB, so index 16 is opaque black; the test still expected a bare zero. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
The toolbar flipped sides mid-drag and the two grips shared one animation slot, so a handle could fly to the top of the screen and slide back; the emoji were fitted from a text measurement that does not describe a colour glyph, so they were drawn past their cells and clipped, and an atlas that started over mid-frame left every emoji on a dead rect. - The toolbar is a glass surface: copy, paste, more and close on the first row, and word, line, all, find, share, run here, new tab and browser in the panel behind the chevron - The grips have their own identity and grow under the finger - Emoji ink is measured from the pixels that were drawn, the atlas slot carries a texel of padding, and a mid-frame reset is rebuilt 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
`Spring.StiffnessMediumHigh` does not exist, so the selection overlay did not compile and neither the APK nor the unit tests could be built. The standalone Native run was a second, quieter failure: `inputs` only carries its defaults when the workflow is called, so on a pull_request `abi` was empty, `DROSH_ABI=""` pointed the link search at `native/ghostty/lib/` itself, and the link ended in "unable to find library -lghostty-vt". The workflow now resolves its own defaults, and the build script treats an empty ABI as no choice at all. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The grip is one plain yellow disc now: the stem read as a stray glyph and the halo as a second handle. A drag is measured from where the finger went down instead of from the disc's own animated position, which fed the spring's lag back into its input and made the grip wander under a steady finger. The menu is less translucent. Settings: the dead switches are gone (Ghostty engine, session surfaces, keep-position), the screen-on setting now actually holds the screen on, and "tap the top edge" joins the ways to raise the keyboard. The Turkish strings were rewritten, fixed for diacritics, and completed where the file fell back to English. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The grid's cards were screenshots of a SurfaceView, which only exists while a session is on screen — and the grid covers the screen, so every background card was a stale frame or a blank one. The picture is now rendered natively from the same wire frame the renderer draws: cells, colours, glyph masks and cursor, encoded as a cached PNG. Nothing needs a Surface, so a background session previews as truthfully as the active one, and the PixelCopy pipeline, its throttle and its dedupe are gone. A card's mark comes from the program the kernel reports in the foreground (/proc/<pgid>/comm), resolved through a program registry; OSC 1 is honoured as a hint and the title's words as the last fallback. The marks are Simple Icons (CC0-1.0) fetched by tools/icons/fetch_icons.py into vector drawables, tinted with the theme instead of shipped as bitmaps. Also: the close question and the empty-filter view are resource strings with Turkish translations, the session screen is fully translated, the setup, block and sidebar strings gained Turkish, and the strings of the removed engine, scrollback and bell settings are gone from every locale. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The preview cache needed std::sync::Mutex, and the module already imports it with MutexGuard a few lines below; the duplicate import failed the native build. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
…at remembers The native preview never had a font: NativeFont.load was unused, so every card was a coloured rectangle. The coordinator now installs the terminal's own face before rasterising, the cache key includes the face's generation, and a render test proves a glyph reaches the pixels. Session names could persist the guest runtime (libchrootng.so — the spelling the old filter missed). Runtime names are now a domain rule, old rows are repaired on open, and no card, bar or sidebar can display one. The grid's pins, drag order and groups live in DataStore through the switcher ViewModel instead of `remember`, so closing the grid no longer undoes them; SessionScreen's chrome and name resolution moved to their own files. The top bar's name is a session dropdown, and block input offers command prediction from this session's own history, behind a new setting. docs/DIAGNOSTICS.md sets out the benchmark, diagnostics and opt-in telemetry plan. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
KSP could not resolve DataStoreSessionGridLayoutStore in BindingsModule, which failed every module that depends on the data bindings. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The font JNI module was never declared in jni/mod.rs, so every preview crashed with UnsatisfiedLinkError; previews now also degrade to a plain picture instead of taking the app down. The row loses the duplicate session switcher, its overflow menu is the slim, sectioned card it was designed as, and selection grips are a rule on the edge with a knob outside it. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The module had never been compiled; its byte-array and string calls used the pre-0.21 shapes. Also return a real empty array instead of a raw null pointer built from a typed handle. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
… bar The session view now lists groups and singles together, a group opens a full-screen management panel instead of a dialog, and splits are chosen inline with a two-frame preview. The terminal row switches sessions from the active session's name, its debug overlay and counter lines are gone, and a build without its guest runtime shows a real dialog rather than a line of debug text.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Structural and rendering work on the terminal engine. CI runs on this branch.
Structure
checkModuleBoundariesTerminalReadyScreen, settings, agent/SSH screens, session screens)TerminalMouse(held button, locked wheel axis, sub-cell remainder); the view keeps gestures and drawingRenderer
= <> ! | & + - * / % ^ ~ . : ?) is shaped once and drawn as one sprite spanning its cells (LigaturePolicy,TextAtlas.run,FrameRenderer.ligatureRunAt); the row packer skips the cells a run coversScreenBackgroundPass)Docs
CHANGELOG.mdanddocs/STATUS.mdnow match the renderer; both previously said ligatures were not drawnVerified
Build DebugandUnit Testsgreen on every commit; new tests cover the ligature policy and the multi-cell sprite packingNot verified