Selections publish the system PRIMARY selection; middle-click, Shift+Insert and Paste Selection read it, and never fall back to CLIPBOARD. Ctrl+V pastes a clipboard PNG as a private file path and falls back to text, while Ctrl+Shift+V and Paste stay text-only. Copy as HTML offers plain text and escaped HTML through Kryon's MIME clipboard, and Kryon's image clipboard replaces the local GTK reader. Alt-click and Ctrl-click open web links, OSC 8 hyperlinks and e-mail addresses through kryon/open_uri in standalone and embedded windows, with a pointer cursor over links. The right-click menu matches xfce4-terminal 1.1.4: link and e-mail actions, Open Tab/Terminal/File Manager Here, Copy, Copy as HTML, Paste, Paste Selection, Show Menubar/Fullscreen/Read-Only check rows, Send Signal and Zoom submenus, Save Contents and Preferences. Right-click keeps the selection and copies nothing until a copy action is chosen. make install also installs the Xfce TerminalEmulator helper. Terminal starts in HOME unless told otherwise, so the helper passes --working-directory=. for the folder Exo starts it in, and runs launch commands with -x because Exo splits them into words. Thunar's Open Terminal Here and exo-open now open the selected folder. Terminal builds against Kryon's package-qualified widget imports now that the Widgets facade and *_props modules are gone, and the lock moves to the Kryon commit with the PRIMARY API and to the matching Ziran toolchain. CI installs the GTK, X11 and xcb development files, ImageMagick, tesseract and exo-utils the build and the new window tests need. The application context-menu test follows the new menu by label. The link test focuses the window and Shift+right-clicks while the child tracks the mouse; the selection test uses a window tall enough to reach Copy and gives each menu copy a fresh CLIPBOARD owner; the rendered-menu test reads 2x captures and waits for the submenu; the Thunar test launches the real Terminal through Exo.
45 lines
1.9 KiB
Bash
45 lines
1.9 KiB
Bash
#!/bin/sh
|
|
# Build the maintained Ziran application; dependency source stays in its package.
|
|
set -eu
|
|
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
cd "$root"
|
|
unset DISPLAY WAYLAND_DISPLAY XAUTHORITY
|
|
|
|
target=${1:-c}
|
|
output=${2:-build/linux-$(uname -m)}
|
|
input=${3:-src/app/app_main.zi}
|
|
case "$target" in c) ;; *) echo "Unknown Terminal target: $target" >&2; exit 2 ;; esac
|
|
mkdir -p "$output"
|
|
output=$(CDPATH= cd -- "$output" && pwd)
|
|
case "$output" in "$root"/build/*) ;; *) echo 'Terminal build output must be under build/' >&2; exit 2 ;; esac
|
|
ziran=${ZIRAN:-"$root/scripts/ziran.sh"}
|
|
lock_flags=
|
|
if test ! -f ziran.local.toml; then lock_flags=--locked; fi
|
|
generated=$output/generated
|
|
"$ziran" build --project $lock_flags --target="$target" --no-main --prune-stale \
|
|
--root src -o "$generated" "$input"
|
|
|
|
jobs=${TERMINAL_BUILD_JOBS:-1}
|
|
case "$jobs" in 1|2|3|4) ;; *) echo 'TERMINAL_BUILD_JOBS must be between 1 and 4' >&2; exit 2 ;; esac
|
|
if test -n "${RAYLIB_A:-}"; then
|
|
raylib_archive=$RAYLIB_A
|
|
else
|
|
raylib=$("$ziran" pkg path raylib $lock_flags)
|
|
cmake -S "$raylib" -B "$output/raylib" -DPLATFORM=SDL \
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_SDL3=ON -DCMAKE_BUILD_TYPE=Release \
|
|
-DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
|
cmake --build "$output/raylib" --parallel "$jobs"
|
|
raylib_archive=$output/raylib/raylib/libraylib.a
|
|
fi
|
|
test -f "$raylib_archive"
|
|
mkdir -p "$output/bin"
|
|
temporary=$(mktemp "$output/bin/terminal.XXXXXX")
|
|
trap 'rm -f "$temporary"' EXIT HUP INT TERM
|
|
"${CC:-cc}" -std=c11 -O1 -ffunction-sections -fdata-sections \
|
|
-I"$generated" "$generated"/*.c -Wl,--gc-sections "$raylib_archive" \
|
|
$(pkg-config --libs sdl2 libwebpdemux libwebp gtk+-3.0 x11 xcb) -lGL -ldl -lpthread -lm -o "$temporary"
|
|
chmod 755 "$temporary"
|
|
mv "$temporary" "$output/bin/terminal"
|
|
trap - EXIT HUP INT TERM
|
|
echo "Terminal executable: $output/bin/terminal"
|