Terminal

Terminal is the standalone terminal application maintained by KryonLabs, using Kryon for windowing, rendering, input, and platform integration. The terminal emulator belongs here, not in Kryon.

make -j1
make standalone-window-test
make independent-window-test
make pane-ziran-test
make standalone-test install-test
make install

The application, terminal engine, pane and shared application host are maintained in Ziran. make generates native C from the current .zi entrypoint and links Kryon's desktop host: an SDL2 window drawn with Cairo and Pango. The build needs a C compiler, pkg-config, and the SDL2, Cairo, Pango, GTK 3, WebP, X11 and XCB development files.

standalone-window-test runs the actual executable on a private Xvfb display. It checks CLI routes, a rendered window, real child-process input, held and repeated Control keys, menu input ownership, and closing its own window. standalone-test repeats these checks from source and saved IR. independent-window-test opens separate agent-terminal views on a private display, checks that repeated launches keep the first window and input working, and verifies that closing a view preserves the other window and both tmux sessions. Its display, configuration, state, runtime locks and tmux socket are disposable.

The window tests need Xvfb, xauth, xdotool, xset and tmux; they scrub inherited session and display variables before creating their private display. cursor-blink-window-test also uses xwd to verify cursor visibility in two windows, focus changes, typing, and terminal-requested steady/hidden modes.

The focused Ziran suites exercise the actual engine, configuration, sessions, launch options, application state, input, view, host, widget, clipboard and process transports. Hosts can import terminal/app_host; begin its frame with Host.BeginFrame so shell keys reach the terminal before retained widget navigation. The host owns the surrounding frame, device input and window operations.

make install installs the terminal command, a desktop launcher named Terminal, and the Xfce TerminalEmulator helper definition. The default PREFIX is ~/.local; DESTDIR supports staged packaging. install-test checks a disposable staged installation.

The Linux release workflow is in .github/workflows/release.yml. Its intended assets are tar.gz, .deb, and .AppImage packages. Release-readiness work is tracked in plans/open-work.md; docs/ZIRAN_MIGRATION.md maps the maintained modules.

Dependencies resolve through scripts/ziran.sh, ziran.toml, and the command-generated ziran.lock. Install Ziran on PATH for a locked checkout. The wrapper selects the package toolchain; if it has not been built, it prints the exact compiler build command. Without local overrides, build and test routes require --locked.

For local development, create the ignored ziran.local.toml with canonical organization-root overrides:

[overrides]
ziran = "../../ziranlang/ziran"
kryon = "../../kryonlabs/kryon"

Additional source-package overrides may point to an existing local package checkout. Local overrides do not belong in the manifest or release artifacts.

Run options:

terminal --working-directory /path/to/project
terminal --default-working-directory /path/to/project
terminal --shell /bin/bash
terminal --command 'make test'
terminal --command='make test'
terminal -e 'make test'
terminal -x make test
terminal --title 'Build'
terminal --command 'make test' --tab --title 'Logs' --command 'tail -f build.log'
terminal --drop-down --title 'System' --command htop
terminal --geometry 120x40
terminal --fullscreen
terminal --maximize
terminal --hold
terminal --font-size 18
terminal --scrollback 10000
terminal --cursor-style bar
terminal --terminal-font /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
terminal --terminal-foreground '#f2f2f2' --terminal-background '#101010' --terminal-cursor '#f2f2f2'
terminal --terminal-selection-foreground '#101010' --terminal-selection-background '#5a8fd8'

Terminal accepts common xfce4-terminal launch options: --command/-e, --execute/-x, --default-working-directory, --title/-T, --hold/-H, --geometry, --fullscreen, --maximize, --drop-down, --disable-server, --tab, --window, and menubar/toolbar/border visibility flags. --tab starts additional tabs from command-line specs. --drop-down starts a borderless top-of-screen terminal window. --window is accepted as a separator and currently opens another tab because Terminal does not have multi-window process/server support yet.

A working directory that is missing, a file, or cannot be entered starts the shell in the home folder with a notice instead. A Thunar custom action writes terminal --working-directory=%f: Thunar quotes %f itself, so quotes around it become part of the path.

Config is read from $XDG_CONFIG_HOME/terminal/config or ~/.config/terminal/config:

font_size=16
scrollback=5000
cursor_style=block
terminal_font=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
terminal_foreground=#f2f2f2
terminal_background=#101010
terminal_cursor=#f2f2f2
terminal_selection_foreground=#101010
terminal_selection_background=#5a8fd8
shell=/bin/bash
working_directory=/home/me/project

String values saved by Terminal use backslash escapes for tabs, newlines, and literal backslashes.

Terminal starts a fresh shell in your home folder by default. A configured working_directory or an explicit launch directory overrides that default. A new tab opens in the current directory of the tab it was opened from. Previous tabs and their last visited folders are not restored automatically. Saved tab metadata remains available to hosts that explicitly restore a session, including the active tab, working directories, shells, commands, scroll positions, and manual titles. The session file lives under $XDG_STATE_HOME/terminal/session or ~/.local/state/terminal/session.

Terminal chrome and default terminal foreground/background/cursor colors follow the Kryon system theme. Explicit profile colors and OSC color changes stay in control until reset.

The cursor stays steady in inactive windows. Focusing a window, switching tabs, or typing restarts its blink with the cursor visible for half a second.

Chinese, Japanese, Korean and other scripts use Kryon's per-glyph system-font fallback while the terminal keeps its monospace cell grid. Install a font covering the script, such as Noto Sans CJK, when the system has none.

Use the Terminal menu to update profile defaults for shell, working directory, terminal font, font size, colors, selection colors, scrollback, cursor color, and cursor style. Changes are saved to the same config file and apply to future tabs; font, colors, scrollback, and cursor changes also apply to the running window.

Shortcuts:

  • Ctrl+Shift+T: new tab
  • Ctrl+Shift+W: close tab
  • Ctrl+Tab: next tab
  • Ctrl+Shift+Tab: previous tab
  • Ctrl+PageUp / Ctrl+PageDown: previous tab, next tab
  • Alt+1 through Alt+8: switch directly to that tab
  • Ctrl+Shift+C: copy selection
  • Ctrl+Shift+V: paste
  • Ctrl+Insert / Shift+Insert: copy selection, paste
  • Ctrl+Shift+F: find
  • Ctrl+Shift+G: find next
  • Ctrl+Shift+B: find previous
  • Ctrl++ / Ctrl+- / Ctrl+0: zoom in, zoom out, reset size
  • Shift+PageUp / Shift+PageDown: scroll

Find searches scrollback plus the visible terminal. Lowercase queries match case-insensitively; queries containing uppercase letters are case-sensitive.

Mouse selection keeps a local primary selection for the terminal; middle click pastes that selection before falling back to the system clipboard, and the right-click menu exposes both clipboard paste and primary-selection paste. Right-click on selected text copies it to the clipboard instead; with nothing selected, or with Shift held, right-click opens the menu. Copied soft-wrapped lines are joined without adding artificial newlines. Bracketed paste wraps pasted text and strips embedded terminal control sequences so copied text cannot break out of the paste bracket. OSC 52 clipboard queries are synced from the host clipboard before terminal output is parsed, and OSC 52 clipboard writes update the host clipboard. OSC 8 terminal hyperlinks are underlined with the theme link color and open with Alt + left click or Ctrl + left click. Visible HTTP and HTTPS URLs also open with either modifier, including links wrapped across terminal rows.

Documentation

Question File
Embed Terminal or a pane in another app docs/EMBEDDING.md
Parser, graphics and mode coverage docs/COMPATIBILITY.md
Read-only viewport projection API docs/VIEWPORT.md
Ziran migration module map docs/ZIRAN_MIGRATION.md
Benchmarks and workloads benchmarks/README.md
Open work plans/open-work.md

Name and repository

The app is Terminal: its private repository is kryonlabs/terminal, its Ziran package and import prefix is terminal, and its command, desktop launcher, configuration (~/.config/terminal/config) and saved sessions (~/.local/state/terminal/session) use the same name.

S
Description
Standalone desktop terminal emulator.
https://ktrem.kryonlabs.com
Readme
2.6 MiB
0 Stars 1 Watchers 0 Forks
Languages
Ziran 83.3%
Python 8.1%
Shell 7.6%
Makefile 0.9%