Skip to content

feat(blueshell): add BlueShell, container-native terminal (org.tunaos.BlueShell) - #714

Closed
hanthor wants to merge 5 commits into
flatpark:mainfrom
hanthor:add/org.tunaos.BlueShell
Closed

hanthor wants to merge 5 commits into
flatpark:mainfrom
hanthor:add/org.tunaos.BlueShell

Conversation

@hanthor

@hanthor hanthor commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What

BlueShell (org.tunaos.BlueShell): Ghostty's rendering engine with a Ptyxis-style terminal UI and first-class Toolbox/Distrobox/Podman container support, from tuna-os. Submitted and maintained by its developer (tuna-os), same as org.tunaos.tavern (#677) and org.tunaos.compass (#678).

Packaging

  • Download: the vendor's prebuilt /app-tree tarballs from the GitHub release (blueshell-<arch>.tar.gz, extra-data, x86_64 + aarch64 under one blueshell.tar.gz filename per house pattern), pinned by sha256+size. This is the same tree the vendor's .flatpak bundle and OCI image ship (exported by feat(flatpak): export per-arch release tarballs for FlatPark tuna-os/blueshell#156).
  • Runtime: org.gnome.Platform 51. The tarball carries the two libraries the runtime lacks (gtk4-layer-shell, libghostty-vt); the wrapper puts its own lib/ on LD_LIBRARY_PATH instead of relinking or copying the payload.
  • Wrapper env only: GHOSTTY_RESOURCES_DIR (same tree, one level deeper) and LD_LIBRARY_PATH. No patches, no sed, no rebuild of the payload.
  • /usr/bin/flatpak run org.tunaos.BlueShell --version prints Ghostty 1.3.1….

Sandbox

  • Granted: --talk-name=org.freedesktop.Flatpak (declared in policy.dangerous_permissions — spawning host shells/tabs/panes and entering containers IS the app; without it the window opens and can run nothing), --filesystem=home:ro (reads the host ~/.config/ghostty only), --filesystem=xdg-run/podman (container picker), --own-name/--talk-name=com.mitchellh.ghostty (upstream single-instance guard; without it the app silently exits).
  • Left out: --device=all (vendor ships it; dropped here — --device=dri covers rendering), --share=network (nothing in the app fetches).

Tested

  • scripts/read-descriptor.mjs + audit-descriptor.mjs: pass (only the declared escape WARN).
  • scripts/check-apply-extra.sh: unpacks the real download as root, all assertions hold.
  • scripts/publish.sh --verify: EXIT 0, installed from local signed repo OK; flatpak run … --version works.
  • aarch64: release asset downloaded, size+sha256 match the pin exactly, tree contains bin/ghostty + libexec/ptyxis-agent, file confirms ARM aarch64 ELF. Can't execute it on x86_64.
  • Couldn't: open an actual terminal window (headless workstation), GUI persistence across restarts.

Flathub

Not on Flathub (checked repo contents, appstream, PRs). Ghostty upstream does not publish there.

….BlueShell)

Repackages the vendor's prebuilt /app-tree tarball from the v1.3.1
release (extra-data, x86_64). Ghostty engine with Ptyxis terminal UI;
host shells and container sessions spawn through flatpak-spawn
(declared in policy.dangerous_permissions).
@jing2uo

jing2uo commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Review: approved pending one test record (static review per docs/reviewers/review-runbook.md; nothing executed)

Thanks, James. Provenance and packaging are clean: both tarballs are byte-identical to the CI artifacts of your Publish Flatpak run, the payload is unpacked unmodified, and nothing in it trips the IOC scan.

  1. The org.freedesktop.Flatpak grant is approved. It is declared in policy.dangerous_permissions with a justification, and a terminal can't run anything without it.
  2. Remaining before merge: please launch it once and look at the window. The PR says no window was opened, and --version doesn't load GTK or libadwaita. The vendor tree was built against GNOME 50 (manifest.json: runtime-version: 50), and this package runs it on 51, so "it starts and draws" is the check that matters here. A headless machine can do it on a private display (testing playbook → It starts and draws): Xwayland :99 … ; DISPLAY=:99 flatpak run --socket=x11 org.tunaos.BlueShell, then a screenshot. If a shell opens a host prompt in the window, that's enough. A tab, and the container picker if you can, would also be good.

Non-blocking:

  • --own-name=com.mitchellh.ghostty takes upstream Ghostty's bus name. What happens when a real Ghostty (native or its own Flatpak) is already running in the session? If BlueShell then exits or opens its window inside Ghostty, a line in the metainfo would help.
  • The metainfo has no <screenshots> (Tavern and Compass do). Upstream URLs are fine; the site fetches them.
  • The v1.3.1 tarballs were attached by hand: the run's "Attach bundles to release" job was skipped. The resolver fails cleanly when an arch is missing, so the only cost is a delay. Still, wiring the attach step for tagged releases would keep future bumps automatic.
  • CI (pr-checks) is waiting for maintainer approval to run on this fork PR.
Full check table
# Check Verdict Evidence
0 Static only, isolated dir ✅ Release assets fetched with curl into a temp dir; tar listed before extract; extracted --no-same-owner --no-same-permissions; nothing run. Only repo-trusted read-/audit-descriptor.mjs run on the YAML.
1.1 Scope ✅ New app registry/org.tunaos.BlueShell/ (8 files) + one row in docs/reference/upstream-approvals.md
1.2 High-scrutiny surface ✅ No .github/, scripts/, config/, signing. Resolver is in a brand-new app dir
2.1 Submitter ✅ hanthor, account since 2013-11, 164 repos; #677 Tavern and #678 Compass merged
2.2 Source repo ✅ tuna-os/blueshell, created 2026-06-05, MIT, Ghostty-derived (upstream history); hanthor is the org's public member and the release author
2.3 Commit identity ✅ All 3 commits by James Reilly <[email protected]>, the same identity as upstream commits
2.4 Timeline ✅ Repo 4 months old; v1.3.1 published 2026-10-14; tarball export (tuna-os/blueshell#156) merged 10-17 17:18; PR 18:04 the same day. That is the developer wiring the export for us, not a fresh account
2.5 Trust tier ✅ Established (the app's own developer)
2.6 Provenance tier ✅ Tier 1: open source (MIT + GPL-3.0-or-later ptyxis-agent)
3.1 Source types ✅ 2× extra-data with sha256 + size (20930820 / 20525111), 5× local file, no git/archive
3.1b Bytes in /app ✅ Module only installs in-repo files; payload is extra-data
3.2 finish-args ✅ Maintainer approved the escape. --talk-name=org.freedesktop.Flatpak declared + justified (flatpark.yml policy.dangerous_permissions); home:ro and xdg-run/podman justified in manifest comments; vendor's --device=all dropped; no network
3.3 policy: honest ✅ proprietary: false is correct; dangerous_permissions matches finish-args. audit-descriptor.mjs: exit 0, only the declared-escape WARN
3.4 build-commands ✅ 5 install -Dm… lines; wrapper sets GHOSTTY_RESOURCES_DIR, LD_LIBRARY_PATH only; no patch/sed/preload
3.4b packaging: ✅ host-command declared; en/zh-Hans text is accurate
3.5 Source URLs genuine ✅ github.com/tuna-os/blueshell/releases/download/v1.3.1/…
3.6 app-id ✅ org.tunaos.* matches the vendor's own id (manifest.json id, its .flatpak bundle)
3.7 update.command ✅ ./resolve-update.sh
3.8 Download host ✅ Vendor's release (not a personal fork)
3.9 Optional caps ✅ No optional broad grant; the developer chose home:ro (read Ghostty config/includes)
3.10 Tested ⚠️ Honest, but no window was ever drawn (see item 2)
4.1 Fetch-and-exec ✅ None in wrapper/apply_extra; Ghostty has no self-updater
4.2 Resolver as code ✅ curl GitHub API + jq; anchored per-arch asset regex, exactly-one match, fails if aarch64 missing; no eval/writes
4.3 Network ✅ No --share=network; host shells carry their own network
5.1 sha256 == pin ✅ x86_64 bc2ce22b…120d, aarch64 08687513…bf78, sizes equal; same as GitHub asset digests
5.2 Archive inspection ✅ 941 entries each, all root/root, no absolute or .. paths, no setuid; symlinks relative and in-tree (share/locale/*, two .so.0), hardlinks in-tree
5.3 Nothing injected ✅ Payload untouched; wrapper env only
5.4 Shipped == official/CI ✅ Release tarballs == artifacts 12109461656 / 12109655922 of tuna-os/blueshell run 39054111217 (built from 8fe6fd1 = v1.3.1 + a workflow-only commit)
5.5 Bundled runtimes ✅ Only libs built in the vendor's pinned Flatpak build (gtk4-layer-shell v1.1.0 tag, libghostty-vt); no node/JRE/electron
5.6 IOC scan ✅ No miner/reverse-shell/persistence/crontab strings in the 4 ELFs or shell-integration; RUNPATH /app/lib:/usr/lib/<triplet> is the vendor's build default; D-Bus service and Ghostty desktop file stay under /app/extra (not exported)
6.1 Purpose ✅ Terminal emulator; own name and icon, Ghostty credited as engine (MIT)
6.2 Non-FOSS ➖ n/a
7.1 Verdict ⚠️ NEEDS-HUMAN on the declared escape, now approved by a maintainer. Merge waits on the GUI test record (3.10)
7.2 Hard-fail triggers ✅ None
7.3 Recommend only ✅ A maintainer merges

@jing2uo

jing2uo commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

We tested it here (x86_64, Debian sid host, Xwayland at 1400x900, built and installed with publish.sh --verify). It works well: the window draws on GNOME 51, a host login shell opens, a new tab from the picker opens a host shell, the containers menu lists the host's Podman containers, and a second launch opens its own window. check-apply-extra.sh passes as root with no capabilities, and nothing new appeared in $HOME.

We found three issues, each with a small fix, all verified on the same machine:

  1. Shell integration is never injected. The log shows warning(shell_integration): unable to open /app/share/ghostty/shell-integration/zsh: error.FileNotFound. Ghostty derives the host-side resources path from /app/share/ghostty rather than GHOSTTY_RESOURCES_DIR, and here the tree lives under /app/extra.
  2. Host programs can't find the xterm-ghostty terminfo. The host shell gets TERMINFO=<app>/files/share/terminfo, which doesn't exist, and most hosts don't ship that entry, so vim, less, clear and the rest see an unknown terminal.
  3. Windows don't group under the app's icon. WM_CLASS is com.mitchellh.ghostty, while the desktop file says StartupWMClass=org.tunaos.BlueShell.

Fix for 1 and 2: two relative symlinks in build-commands. They resolve both inside the sandbox and from the host path Ghostty hands the shell:

      - ln -s ../extra/blueshell/share/ghostty /app/share/ghostty
      - ln -s ../extra/blueshell/share/terminfo /app/share/terminfo

Fix for 3, in blueshell-wrapper:

exec /app/extra/blueshell/bin/ghostty --gtk-single-instance=false --class=org.tunaos.BlueShell "$@"

With these changes the integration warning is gone, the host shell gets ZDOTDIR and TERMINFO paths that exist, infocmp xterm-ghostty resolves, tab titles follow the cwd, and WM_CLASS is org.tunaos.BlueShell. With --class GTK registers org.tunaos.BlueShell on the bus, so --own-name/--talk-name=com.mitchellh.ghostty may no longer be needed; please check before dropping them.

Not tested here: the native Wayland session, and entering a container (we didn't touch the host's containers). Push these changes and this is ready to merge.

@jing2uo

jing2uo commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

@hanthor Two more things.

We're fine with manifests written quickly with an agent's help. The part we can't skip is actually running the app before it ships. All three issues above show up the first time you open a window and use the shell, and we don't want to push a package to users that doesn't work for them. So for the next ones, please launch each app once and use its main feature; the testing playbook shows how to do that on a headless box.

With Tavern, Compass and now BlueShell, you have three apps here. Would you like a TunaOS collection? That's one page on the site that presents your apps together, like the ArtCraft one: https://flatpark.org/collections/artcraft/. We'd rather not pick the name and blurb for you, so if you're interested, send a name and a two- or three-sentence description (and a link to an upstream page, if there is one), and we'll set it up.

…bus names

Shell integration and terminfo resolve at the paths Ghostty hands host
shells via relative /app/share symlinks; --class aligns WM_CLASS/app_id
with StartupWMClass; --own/talk com.mitchellh.ghostty proven unneeded
since --class registers org.tunaos.BlueShell and multi-window launch works.
Display name Blueshell everywhere user-visible; technical surfaces
(manifest id, desktop Icon/StartupWMClass, metainfo id/launchable,
wrapper --class) use the lowercase id. apply_extra keeps asserting the
old-cased desktop filename because the pinned v1.3.1 vendor tarball
still ships it; the next vendor release must update that assertion.
@hanthor

hanthor commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Two things:

App id lowercased. Per the no-BlueShell rule, the id is now org.tunaos.blueshell with display name Blueshell (menu label _About Blueshell, wrapper --class, desktop/metainfo, blueshell repo files + docs renamed; Ghostty/Ptyxis/engine/protocol/po untouched). Renaming the head branch auto-closed this PR, so review continues in #717 — same package plus the fixes from your review (resource/terminfo symlinks, --class, ghostty bus names dropped, all verified in the new PR body).

TunaOS collection: yes please, we're onboard. Proposed name: TunaOS. Blurb: TunaOS makes cloud/container-native Linux desktop tools and images Upstream link: https://tunaos.org. Happy to tweak the wording.

@hanthor

hanthor commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Small correction to my collection note above: the upstream link should be https://tunaos.org (project site), not the GitHub org. Same proposed name TunaOS and blurb otherwise.

jing2uo added a commit that referenced this pull request Oct 18, 2026
Name, summary and upstream link are the developer's own, from
#714. Blueshell (#717) is listed ahead of its merge; the site
skips an id not yet in the catalog with a build warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants