Files
ddidderr 30863e1f0b test(gtk): live D-Bus/portal comparison against the original Ghostty
Adds scripts/live-dbus-test.sh (`just live-dbus`): each scenario runs
the installed Ghostty 1.3.1 and the Rust build on a private
dbus-run-session bus inside a private headless weston (the user's
session bus is never written to), with Python/Gio mocks for
org.freedesktop.Notifications, the GlobalShortcuts/Settings portal and
org.freedesktop.systemd1, plus a real xdg-desktop-portal run. Scenarios:
single-instance (+detect), +new-window with arguments, notifications,
global shortcuts, color-scheme settings, cgroup scope creation, URL
opening. tests/live_dbus.rs compares the Rust build against goldens
recorded from the original (skips when tools or a fresh production
build are missing).

Two Rust bugs found and fixed (no upstream deviation):
- GlobalShortcuts CreateSession/BindShortcuts payloads used the wrong
  D-Bus signatures ((v), double-boxed values), which a real portal
  rejects; signature tests added.
- CreateSession was sent twice at startup; the config is now bound only
  after the D-Bus connection is set, as in Zig.

All nine scenarios now behave identically to the original
(docs/rewrite/notes/live-dbus.md).

Test Plan:
- just live-dbus
- cargo test --test live_dbus (needs target/vp/production/ghostty)
2026-10-12 18:49:53 +02:00

21 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
# Terminal child for the notifications scenario.
esc=$(printf '\033'); bel=$(printf '\007')
sleep 2
printf '%s]9;osc9 body%s' "$esc" "$bel"; sleep 1.2
printf '%s]777;notify;Title777;Body777%s' "$esc" "$bel"; sleep 1.2
printf '%s]777;notify;;OnlyBody%s' "$esc" "$bel"; sleep 1.2
printf '%s]777;notify;Only title;%s' "$esc" "$bel"; sleep 1.2
printf '%s]9;<b>markup</b> & "quotes" \303\251\342\202\254%s' "$esc" "$bel"; sleep 1.2
printf '%s]9;osc9 body%s' "$esc" "$bel"; sleep 1.2
printf '%s]777;notify;semi;colon;body%s' "$esc" "$bel"; sleep 1.2
# command finished (OSC 133 prompt marks): C then D;3 after >1s
printf '%s]133;A%s%s]133;B%s%s]133;C%s' "$esc" "$bel" "$esc" "$bel" "$esc" "$bel"; sleep 2
printf '%s]133;D;3%s' "$esc" "$bel"; sleep 1.5
printf '%s]133;A%s%s]133;B%s%s]133;C%s' "$esc" "$bel" "$esc" "$bel" "$esc" "$bel"; sleep 2
printf '%s]133;D;0%s' "$esc" "$bel"
# wait for the harness to ask for one more notification
while [ ! -e "$FLAG2" ]; do sleep 0.3; done
printf '%s]9;after reload%s' "$esc" "$bel"
sleep 60