lios 0.1.88

Lios Linux terminal with native Aen and GTK4/VTE frontends.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# Lios

Lios also has a native **Aen** frontend for KnottCompositor. Build the same `lios`
executable with `cargo build --locked --no-default-features --features aen`.
For installation from this repository use
`cargo install --git https://github.com/Tknott95/KnottTerminal --locked --no-default-features --features aen`.
This selects a real PTY and native Aen windows with no GTK or alternate display
backend. Its Aen v3 input protocol carries bounded UTF-8 text commits for
multi-scalar input while retaining physical key events for terminal controls. See
[native frontend usage and acceptance](docs/aen.md). Since Lios 0.1.88,
`cargo install lios --locked --no-default-features --features aen` selects it
from crates.io. Rust 1.88 or newer is required.


Lios is a gorgeous, fast, real Linux terminal by Knott Dynamics and Trevor Knott. It uses GTK4 and VTE for correct terminal behavior, then layers on the parts that make a terminal feel premium every day: live themes, glass backgrounds, session-only Bash prompt profiles, Sixel images, same-directory windows, and safe GPU controls.

Created and maintained by Trevor Knott through Knott Dynamics.

If you want a terminal that looks custom without becoming fragile, Lios is built for that. It does not fake terminal behavior, does not edit your shell startup files for prompt experiments, and does not hide risky renderer choices behind defaults. It gives you a reliable VTE core with a strong visual system and fast live controls.

## Why Lios

- Real terminal behavior from VTE, not a toy parser.
- Premium visuals built in: curated themes, glass opacity, background images, accent tint, cursor profiles, and live preferences.
- Session-only Bash prompt profiles for the current terminal, without editing `.bashrc` or persisted config.
- Same-directory new windows for smooth shell workflows.
- Sixel rendering, when provided by the system VTE build, and terminal identity exports for modern CLI image workflows.
- Reliable Cairo rendering by default, with explicit opt-in GTK auto/OpenGL/Vulkan modes when you want GPU acceleration.
- Small, local, and boring where it matters: no telemetry, no background downloads, no secret storage.

## Features

- GTK4 window with a VTE terminal widget.
- Spawns `$SHELL`, with common Unix shell fallbacks.
- Optional `-- COMMAND ...` and `--command "..."` launch modes.
- Dark readable defaults: white-on-black palette, opaque dark backing layer, `Monospace 12`, block cursor, 1,000 lines of scrollback.
- Built-in themes plus strict named custom themes authored in TOML and available everywhere themes can be selected. The Bronco preset combines Ember colors, the Lightbar Bash prompt, and a cyan accent.
- Slider-based master/full-window opacity plus nested image, terminal shade, and accent opacity controls.
- Background image support with `~` path expansion, fixed color tint, or per-launch random accent tint.
- Asynchronous, coalesced wallpaper decoding with guarded source work and bounded logical texture memory.
- Packaged default background image for first launch on new machines.
- Explicit visible mouse pointer over the terminal instead of VTE's dark text cursor shape.
- Renderer controls: reliable `cairo` by default, GTK-managed automatic selection with `auto`, or explicit OpenGL (`gl`) and Vulkan (`vulkan`) overrides.
- Child shells get `TERM=xterm-256color`, `COLORTERM=truecolor`, and `TERM_PROGRAM=lios`; Sixel rendering is enabled when the system VTE build supports it.
- Bash prompt profiles are session-local: `shell-default` leaves shell prompts untouched, while `lightbar`, `timebar`, `fibonnaci`, `fano-plane`, `alice-bob`, and `akira` initialize Lios-only prompt variables when a new Bash terminal starts without writing shell startup files.
- Desktop launcher install with `lios --install` or `lios ---install`.
- App icon installed from `assets/logo.png`.
- Optional window decoration/topbar removal.
- Slim topbar with a collapsible in-window preferences drawer for common live theme/background changes.
- Compact keyboard-first literal scrollback search with optional case-insensitive and whole-word matching, wraparound, and retained per-window queries/options.
- `Ctrl+Shift+N` and `New Window` open a borderless terminal in the active terminal directory.
- Optional integrated LiosBar workspace (`Ctrl+Shift+T`) with up to 32 full Lios terminals, a resizable cyan-on-black sidebar, and per-session search, Preferences, and close protection.
- Persistent right-click appearance submenus for background images, terminal glass, accent presets, random tint, and themes; Menu or Shift+F10 opens the same keyboard-accessible menu.
- Right-click diagnostics for active windows, RSS, scrollback, terminal identity, image protocol, theme, background, and config path.
- Terminal-driven config commands for theming from a shell or script.
- Clipboard/context actions for inline link opening/address copy, copy, copy as HTML, paste, select all, and `Find...`.
- Adaptive literal search stays live for ordinary buffers and switches to explicit Enter/Prev/Next scans for large scrollback, avoiding a synchronous scan on every edit.
- Atomic config saves follow existing symlinks and update their resolved target without severing the link.
- Shell-controlled titles are bounded, whitespace-normalized, and prefixed with the configured app title; BEL produces a quiet visual pulse instead of disappearing silently.
- Guarded terminal clipboard paste: ordinary single-line text pastes directly, while line breaks, disallowed control characters, and text over 4,096 UTF-8 bytes require native confirmation.
- Safe multi-file drag-and-drop inserts shell-quoted local paths (or remote URIs) at the cursor without executing them; oversized drops are rejected.
- Active-process close protection warns before a shortcut, menu action, or window control terminates a detectable external command, explicit launch, or background shell job.
- OSC 8 hyperlinks and detected `http`, `https`, and `file` text use VTE's safe pointer hit-testing. Hold Ctrl and click to open a link; Lios requires the press and release to stay on the same link. Use Ctrl+Shift when you want normal terminal selection over a link.
- Fixed cursor color profiles for `XFCE Red`, `Violet`, `Cyan`, `Emerald`, `Amber`, and `Rose`, plus persistent cursor-to-accent matching.
- Keyboard shortcuts for `Ctrl+Shift+C`, `Ctrl+Shift+V`, `Ctrl+Shift+A`, `Ctrl+Shift+F`, `Ctrl+Shift+N`, `Ctrl+Shift+Q`, `Ctrl+Shift+,`, `Ctrl++`, `Ctrl+-`, and `Ctrl+0`. Menu or Shift+F10 opens the terminal context menu. In search, `Enter` finds next, `Shift+Enter` finds previous, and `Esc` closes the context menu, search, then preferences before reaching the terminal.

Search opens with `Ctrl+Shift+F`. Turn **Match case** off to find `Error` with
`error`, or enable **Whole words** to exclude matches inside longer words and
identifiers such as `error_count`. Search text stays literal (for example,
`.*` searches for those two characters). Queries and options are remembered
until that terminal session closes; no global appearance settings change.

## Links

- [Source repository](https://github.com/Tknott95/KnottTerminal)
- [crates.io package](https://crates.io/crates/lios)
- [docs.rs package page](https://docs.rs/lios)
- [GTK4 project](https://www.gtk.org/)
- [VTE terminal widget](https://gitlab.gnome.org/GNOME/vte)

## Author and License

Lios is created by Trevor Knott through Knott Dynamics. It is distributed
under your choice of the MIT License or Apache License 2.0. The packaged
`NOTICE` preserves the project attribution alongside both canonical license
texts.

## Installation

The crates.io default has no GTK, GDK, VTE, GLib, or other native build dependencies. Install it normally:

```sh
cargo install lios
lios
```

The first `lios` run detects apt, DNF, Pacman, Zypper, apk, or XBPS; installs the matching distribution-managed GTK4/VTE development packages; replaces the bootstrap with the full native terminal from the exact same crates.io release; verifies the replacement before executing it, installs the desktop launcher, and starts Lios. `lios install` provisions without launching. The bootstrap's `lios --check` reports build dependencies and architecture; after native installation, the same command adds toolkit, display-session, and renderer diagnostics. Sudo or doas is requested only for system packages.

Lios native code deliberately stays on the GTK 4.0 API floor and supports later GTK 4.x releases through GTK's stable major-version ABI. It requires VTE GTK4 0.70+ for coordinate-safe link hit-testing. GTK3 is a different ABI and widget toolkit, not an older GTK4 runtime that one binary can select dynamically; a GTK3 build would require a separate frontend.

The bootstrap does not install private copies of GTK or VTE into `/usr/local`. Native terminal libraries are security-sensitive and must remain under the distribution's update system. A distribution without VTE GTK4 0.70+ needs a newer repository or a maintained portable Lios package. Upstream VTE releases before 0.76.3 are affected by [CVE-2024-37535](https://security-tracker.debian.org/tracker/CVE-2024-37535); `lios --check` warns below that upstream baseline, while allowing for distributions that backported the fix without changing the upstream version number. Keep the distribution's security updates applied. `CARGO_BUILD_JOBS` defaults to two to limit memory use on embedded systems and can be overridden.

No single native binary can cover every Linux CPU, both glibc and musl, every display stack, and immutable/package-managed systems. The supported source build is Linux on a Rust-supported Unix architecture with GTK 4.0+, VTE GTK4 0.70+, and either a working Wayland or X11 GDK backend. Run `lios --check` when diagnosing a machine; it does not require a working display merely to report toolkit versions, and it separately reports whether GTK can connect to the current display session.

CI defines a Debian 12 GTK 4.8/VTE 0.70 compatibility job and an Ubuntu 24.04 job. Both include real preferences-layout and save tests under Xvfb, as well as native unit tests. These jobs guard against accidental use of newer GTK/GDK/VTE symbols when runners are available; check their actual results rather than treating the workflow definition as proof of compatibility. GDK is shipped as part of the selected GTK4 runtime; it is not a separately swappable UI API.

For development or systems already provisioned with GTK4 and VTE GTK4 headers, build the full terminal directly with `--features native`.

## Run

Install from crates.io:

```sh
cargo install lios
lios
```

Run from source:

```sh
cargo run --features native
cargo run --features native -- --working-directory "$HOME"
cargo run --features native -- -- htop
cargo run --features native -- --command "ls -la"
cargo run --features native -- --theme solarized-dark
cargo run --features native -- --gpu
cargo run --features native -- --gpu-mode vulkan
cargo run --features native -- --renderer gl
cargo run --features native -- --opacity 0.88
cargo run --features native -- --background-image ~/Pictures/wallpaper.jpg --background-opacity 0.50 --random-overlay
cargo run --features native -- --hide-titlebar
cargo run --features native -- config init
cargo run --features native -- config set gpu on
cargo run --features native -- config set gpu_mode gl
cargo run --features native -- config set theme solarized-dark
cargo run --features native -- config set renderer gl
cargo run --features native -- config set background.image ~/Pictures/wallpaper.jpg
cargo run --features native -- config set topbar false
```

## Clipboard Safety

Context-menu `Paste` and `Ctrl+Shift+V` use guarded terminal paste. `Shift+Insert` uses the same guard only while the terminal owns focus, so paste in search and preference text fields stays local to those fields. Middle-click primary-selection paste remains VTE behavior and is intentionally not intercepted.

Empty clipboard text is a no-op, and normal single-line text (including tabs) pastes immediately. Clipboard text requires confirmation when it contains LF, CR, or CRLF line breaks, disallowed C0/C1 controls, or more than 4,096 UTF-8 bytes. The confirmation shows only reason and count metadata, never the clipboard contents. Assessment of large text runs off the UI thread and is cancelled when it becomes stale; a single text paste above 64 MiB is rejected with a clear warning to bound memory and latency.

## Integrated LiosBar workspace

Press `Ctrl+Shift+T`, choose **New LiosBar Session** in the right-click menu,
or use **Preferences → Plugins → New integrated LiosBar session**. From a normal
terminal, this opens a separate workspace without moving or restarting the
original shell. Inside a workspace, it adds another session to that window.
Normal startup remains a single terminal with your existing defaults.

The integrated sidebar is cyan-on-black and resizable. Each session retains
its full Lios wallpaper, prompt, scrollback, Preferences, and search settings.
New sessions inherit the active directory, not the original command line.
Exited shells remain visible for inspecting output; closing a busy session or
workspace asks for confirmation. Switching sessions cancels pending pastes.

- `Ctrl+Shift+T`: add a session (up to 32).
- `Ctrl+PageUp` / `Ctrl+PageDown`: switch sessions.
- `Ctrl+Shift+PageUp` / `Ctrl+Shift+PageDown`: move the active session up/down without switching terminals; stop at the ends.
- `Ctrl+Shift+W`: close the selected session.
- `Ctrl+Shift+R`: rename the selected session.
- `Ctrl+Shift+B`: move the sidebar left/right and remember the choice.
- `Ctrl+Shift+L`: filter sessions by name/title; Up/Down preview matches, Enter switches to the highlighted session, and Escape clears the filter and returns to the current terminal. Browsing does not switch shells.
- `Ctrl+Shift+N`: open a separate normal Lios window.

Filtering is literal and case-insensitive, with a 128-character limit. It
does not switch the active terminal. Navigation keeps its selected row visible;
clicking the current row returns keyboard focus to that terminal. Background
title updates preserve a still-matching preview and its scroll position.

Drag sidebar rows above or below one another to rearrange sessions; cyan lines
mark insertion points. Drops only accept rows from that same workspace, never
external text or terminals from another window. Navigation follows the new
order without restarting shells. Order lasts for the current workspace only.

The gear beside **SESSIONS** opens Sidebar Layout: compact rows, shell-title
visibility, and keyboard hints. Exit details remain visible, and hidden titles
stay searchable. Reset layout restores these three display choices without
changing sessions, sidebar position, wallpaper, or terminal settings.

Lios remembers these choices and left/right placement in its own config:

```toml
[workspace]
sidebar = "left"
compact = false
show_titles = true
show_hints = true
```

They are also available through `lios config set workspace.compact true` and
the other matching `workspace.*` keys. Divider widths and session names remain
local to the running workspace. The standalone LiosBar app uses its separate
`bar.toml`; neither app edits the other's configuration.

This is an in-process Rust component, not a wrapper around another executable.
No extra installation is needed. Lios includes the reviewed LiosBar widget
snapshot and its licenses; terminal/process ownership stays in Lios. Workspaces
are not restored after the application exits.

## Optional Plugins

Core Lios stays small. Optional helpers use separate `lios-*` packages.

The separate `lios-bar` application also provides a standalone GTK4/VTE
workspace. Unlike the integrated mode above, it runs independently and uses
its own settings. It is developed in the LiosBar repository and installed
separately; its executable is not bundled into Lios.

Lios Preferences now includes a `Plugins` card. Installation discovery and
Cargo metadata verification run without blocking the GTK UI. Its curated catalog can
install the exact reviewed LiosBar release, enable or disable its Lios
integration, repair an unverified or stale install, and launch it. Installation
occurs only after an explicit click or enable action. Disabling preserves the
binary and never terminates an already-running plugin process; it only stops
Lios from presenting that plugin as active.

Lios 0.1.88 pins the standalone card to LiosBar 0.1.8, including per-session
terminal Find, session filtering/reordering, and saves that preserve dotfile links and comments.
Install the new version from Preferences to use it; earlier versioned plugin
directories and running processes remain intact.

```sh
cargo install lios-bar
lios-bar
```

The standalone `LiosSSH` plugin launches OpenSSH inside Lios without storing
hosts, passwords, keys, or SSH config. Its source and package files are not
bundled with core Lios:

```sh
cargo install lios-ssh
lios-ssh user@example.com
lios-ssh -p 2222 user@example.com
lios-ssh --theme solarized-dark -- -J jump.example.com user@example.com
```

The helper wraps `lios -- ssh ...` using argv. OpenSSH still handles `~/.ssh/config`, SSH agent, known hosts, keys, jump hosts, and verification.

See [PLUGINS.md](PLUGINS.md) for the trust model, install metadata checks, and
the contract future official plugins must meet.

## Configuration

Lios reads `~/.config/lios/config.toml` by default when it exists. Use `--config path/to/config.toml` to load another file.

```toml
[window]
title = "Lios"
width = 960
height = 640
decorated = false # set true to show the topbar/window decorations
renderer = "cairo" # auto lets GTK choose; gl/vulkan force a backend; cairo is software
opacity = 1.00 # master/full-window opacity

[terminal]
font = "Monospace 12"
scrollback_lines = 1000 # max 100000

[[custom_theme]]
name = "midnight-copper"
base = "default"
foreground = "#f4e7d3"
background = "#100c0a"
cursor_background = "#d97745"
cursor_foreground = "#100c0a"
palette = ["#100c0a", "#c65f46", "#7f9f5f", "#d4a656", "#6688aa", "#a8759b", "#5f9f9a", "#d8c8b8", "#5b504a", "#e07a5f", "#9fbd78", "#f2cc72", "#82a7c9", "#c394b7", "#7fc2ba", "#fff4e6"]

[theme]
name = "midnight-copper"
# Optional custom overrides:
# foreground = "#ffffff"
# background = "#000000"
# Optional XFCE Red cursor preset values:
# cursor_background = "#e6192e"
# cursor_foreground = "#a51d2d"
# cursor = "#e6192e" # legacy alias for cursor_background
# cursor_match_overlay = false # cursor follows an existing effective accent
# unified_accent = false # enables a visible accent and matches the cursor
# palette = ["#000000", "#aa0000", "#00aa00", "#aa5500", "#0000aa", "#aa00aa", "#00aaaa", "#aaaaaa", "#555555", "#ff5555", "#55ff55", "#ffff55", "#5555ff", "#ff55ff", "#55ffff", "#ffffff"]

[[theme_profile]]
name = "Copper Glass"
theme = "midnight-copper"
font = "Monospace 12"
window_opacity = 0.95
terminal_opacity = 0.50
overlay_color = "#d97745"
overlay_opacity = 0.12
random_overlay = false

[background]
image = "@default" # original bundled wallpaper, or a path to your own image
image_opacity = 1.00
terminal_opacity = 0.50
# Use lower values for more glass/desktop transparency.
# overlay_color = "#7c3aed"
overlay_opacity = 0.18
random_overlay = true

[plugins]
lios_bar = false # Preferences manages this without uninstalling the binary
```

CLI flags override the config file for one run. Use `--gpu` to let GTK select an accelerated renderer for the active GTK/GDK/driver combination, `--gpu-mode gl` to force OpenGL, `--gpu-mode vulkan` to explicitly try Vulkan, and `--no-gpu` to force the Cairo renderer. Explicit renderer overrides use GTK's `GSK_RENDERER` diagnostic interface and therefore apply on the next launch; `auto` leaves it unset. The text config stores this as `window.renderer` so older configs remain valid.

### Custom Themes

Each `[[custom_theme]]` defines one reusable terminal color theme. Its `name` must be a unique lowercase slug such as `midnight-copper`; names cannot collide with a built-in name or alias, including legacy aliases such as `xfce`, `xterm`, and `dracula`. `base` defaults to `default` and must resolve directly to a built-in theme. Custom themes cannot inherit from other custom themes.

The optional `foreground`, `background`, `cursor_background`, `cursor_foreground`, and `palette` fields override the built-in base. Colors must be valid GTK color strings and `palette`, when present, must contain exactly 16 valid colors. An omitted cursor field inherits the base cursor; an empty cursor string explicitly clears it. Unknown fields, duplicate names, invalid slugs, unknown bases, invalid colors, and incorrectly sized palettes make configuration loading fail without replacing the existing config during a save.

Select a custom theme with `[theme].name`, `lios --theme midnight-copper`, or `lios config set theme midnight-copper`. Config-file custom themes are also listed once after the public built-ins in Preferences and the right-click `Theme` menu. Theme matching is case-insensitive, while the stored effective name is canonical. Selecting a named theme deliberately removes active `[theme]` foreground/background/palette/cursor overrides; saving unrelated preferences preserves those overrides, custom-theme tables and comments, and unrelated TOML sections.

Use `lios config themes` to inspect the active theme and every selectable built-in or configured name without launching GTK or installing assets. `lios config validate` preflights the complete default config without changing it, including strict known-section fields, custom themes, and appearance profiles; legacy `terminal.prompt_profile` remains accepted and preserved but ignored because prompts are runtime-only. `lios config theme-template quiet-night --base solarized-dark` prints a valid inheriting `[[custom_theme]]` block whose optional color fields can be uncommented before adding it to the config.

Appearance profiles and custom themes are different. A custom theme is an authored reusable color scheme; a `[[theme_profile]]` is a saved complete appearance containing a theme reference plus font, opacity, background, accent, cursor, and window choices. Profile names are unique case-insensitively so updates and authored comments always belong to one unambiguous table. Profiles may reference custom theme names and can be saved or applied from Preferences. Duplicate names and invalid profile theme references fail clearly during config loading.

Theme cursor colors can be configured as a pair with `theme.cursor_background` and `theme.cursor_foreground`; leaving both unset keeps the theme's inherited cursor. Existing `theme.cursor_match_overlay` configurations retain their cursor-only behavior, while `theme.unified_accent = true` enables the coordinated overlay and cursor mode for the current terminal and newly opened windows. The red XFCE-style pair shown above is available as a fixed `XFCE Red` profile, alongside `Violet`, `Cyan`, `Emerald`, `Amber`, and `Rose` cursor profiles. Existing configs that use `theme.cursor` still work as a cursor-background alias. Preferences include cursor and accent color pickers, fixed presets, an `Inherit` control that removes active cursor overrides, and compact saved appearance profiles backed by `[[theme_profile]]` tables. An explicitly empty cursor string in TOML remains available when a theme's own cursor should be disabled rather than inherited.

Unified Accent is the master visual-match toggle. It keeps the cursor on the effective overlay color and guarantees that an accent is visible: an existing fixed accent is preserved, otherwise random accent mode is enabled, and zero accent opacity is raised to the normal default. Selecting a fixed cursor profile, clearing cursor colors, clearing the accent, or reducing accent opacity to zero turns Unified Accent off.

Bash prompt profiles are runtime-only choices for the current Lios-managed Bash session. `lightbar`, `timebar`, `fibonnaci`, `fano-plane`, `alice-bob`, and `akira` refresh an idle Bash prompt immediately; no Enter or Apply is needed. A private Readline macro saves and restores your partially typed line and cursor while regenerating the prompt. Foreground jobs, raw-mode reads, and secondary prompts defer the selection until the next primary prompt. Bash 4.4+ supports immediate refresh; older Bash retains next-prompt updates. `shell-default` restores the original prompt. Each Bash starts with a private rcfile that sources your `.bashrc` and adds a prompt hook while preserving existing scalar or array `PROMPT_COMMAND` hooks. The application updates a private, data-only profile selection file; it never types setup commands into the PTY. Before sending the private refresh binding, Lios checks the managed shell executable, primary-prompt marker, foreground process group, child processes, and terminal editing mode. New windows inherit the selection, but prompt choices remain unpersisted and `.bashrc` is not edited. Other shells and explicit command launches are not modified.

Use `window.opacity` or `--opacity` as the main full-window opacity. This affects the whole terminal UI and is the primary control for app transparency.

Background images are rendered against the theme background and composited below a transparent VTE terminal. Image probing and scaled decoding run asynchronously through a serialized, duplicate-coalescing queue, so changing a wallpaper does not synchronously decode it on GTK's UI thread. `image_opacity` controls how strongly the image blends into the theme-colored base. `terminal_opacity` is the nested terminal shade layer over that image; lower values show more image while preserving readable text. Without an image, use the master opacity for reliable transparent-terminal behavior, then use `terminal_opacity` only as the inner shade. If an older config has an image with `terminal_opacity = 1.00`, Lios uses the image shade at runtime so the image is not hidden by a fully opaque terminal background.

Fresh installs use the original packaged wallpaper with full image brightness, 50% terminal shading, and an 18% random accent tint. `lios config init` and `lios config sample` now use the same background preset through `image = "@default"`, a portable reference to the bundled asset. A missing bundled file is reinstalled on launch. Existing custom image choices and an explicitly cleared background remain respected. In Preferences, **Original Look → Apply & Save** restores the original appearance, even if a custom image has disappeared or an appearance field contains invalid text.

The topbar is hidden by default. `Ctrl+Shift+F` opens the compact search bar and selects its retained query. Search is literal, case-sensitive, wraparound, and limited to 1,024 characters. Live results are debounced while the actual terminal buffer is at most 10,000 rows. Larger or unmeasurable buffers show `Press Enter to search` and perform no scan while you type; use `Enter` / `Next` to search or move forward and `Shift+Enter` / `Prev` to search or move backward. A slow live scan also switches that search session to explicit scans. `Esc` closes search. `Ctrl+Shift+N` opens another borderless terminal in the active directory; `Ctrl+Shift+Q` closes the current window.

### Preferences

The Preferences subtitle shows the version **running in that window**. Updating
Lios on disk does not upgrade existing windows or their **New Window** action;
launch `lios` again to use the updated version without closing ongoing work.

Choose **Lizard** under **Appearance → Color theme** for a dark forest-green
background, pale green text, emerald accent, and a softly glowing green frame.
It keeps your wallpaper, font, and current Bash prompt. The normal startup look
is unchanged until you select it.

**Appearance → Border & glow** works with any theme: turn the frame on or off,
choose a width from 1–8 logical pixels, and adjust glow (zero turns glow off).
Leave the color empty to follow the current accent, or pick your own color.
Active windows glow more strongly; inactive borders dim. The frame is drawn
inside the terminal, without requiring compositor border/shadow support, and
reserves space so it does not cover text or intercept mouse input.
Borders are saved with preferences and named profiles. **Original Look** turns
them off and restores the existing bundled appearance.

```toml
[border]
enabled = true
width = 2
glow = 0.6
color = "" # automatic accent; or e.g. "#10b981"
```

The same fields are available via `lios config set border.enabled true`,
`border.width`, `border.glow`, and `border.color`.

`Ctrl+Shift+,` or `Open Preferences...` in the context menu opens Preferences. Search and Preferences close one another; hiding Preferences preserves unsaved controls. The overlay has five focused pages: Appearance, Background, Terminal, Profiles, and Plugins. Tabs become a section dropdown in narrow windows. Page content scrolls independently while the save controls remain visible.

Appearance contains theme, font, cursor presets/swatches, and accent controls. Background contains the image picker and layered opacity. Terminal contains the current terminal's Bash prompt profile, title bar visibility, GPU controls, and the active config destination with `Open Folder` and `Copy Path` actions. Session-only mode disables the file actions.

An amber `UNSAVED` badge identifies pending edits. `Apply & Save` applies them and saves asynchronously; `Revert` restores the last saved settings, including a preview whose save failed. Background `Browse`/`Clear` and `Original Look` follow this same Apply/Revert behavior. Saving disables the form until the result is known. Errors remain visible and keep edits available to retry. Independent settings/profile edits made in another window or process are merged into the latest config instead of being overwritten by an old form.

`Ctrl+S` or `Ctrl+Enter` applies pending changes; `Ctrl+R` reverts them. These shortcuts and Tab navigation stay inside Preferences, and terminal zoom shortcuts do not intercept entry editing. `Esc` closes the overlay. Live Edit starts off whenever Preferences opens, coalesces edits for 800 ms before applying and saving, and turns off when the overlay closes. It reports actual save failures rather than clearing the unsaved state prematurely.

Profiles retain explicit immediate actions: Enter or `Add / Update` saves the controls as a named look and applies it; selecting a saved profile applies and saves it; `Remove` only deletes its saved metadata without discarding pending appearance controls. Prompt choices apply immediately in the current idle Bash session, independently of Apply/Revert; renderer changes apply on the next launch. Preferences save to the active config path, normally `~/.config/lios/config.toml`.

Right-click inside the terminal for quick actions, or use Menu/Shift+F10. Right-clicking a supported inline link enables `Open Link` and `Copy Link Address`; link actions never invoke a shell. The menu defaults to `Keep Open Between Actions`, so repeated appearance tuning returns to the same anchor instead of disappearing. Click outside the menu, choose `Close Menu`, or press Esc to dismiss it; one-shot terminal/navigation actions close it automatically. `Keep Open Between Actions` never prevents outside-click dismissal. `New Window` opens a borderless terminal in the active terminal directory. `Copy Working Directory` places the live shell directory on the clipboard, while `Open Working Directory` launches it in the desktop file manager. Both fall back to the launch or process directory when VTE has not reported one. `Close Window` manages terminal windows. `Diagnostics` prints resource state into the terminal. `Restore Original Look` returns the current window to the original bundled wallpaper, default font, shading, and accent tint. The `Opacity` submenu starts with master/full-window opacity controls, then nests terminal shade controls under `Terminal Shade`. The `Background` submenu changes/clears images, adjusts image brightness, or resets the whole background. `Cursor` applies fixed cursor profiles (`XFCE Red`, `Violet`, `Cyan`, `Emerald`, `Amber`, `Rose`), enables Unified Accent, or restores the inherited default. `Bash Prompt · This Terminal` selects the current Bash session's prompt profile. `Accent` switches fixed accent presets (`Violet`, `Cyan`, `Emerald`, `Amber`, `Rose`), toggles random accent tint, and adjusts accent strength. The `Theme` submenu switches public built-ins and configured custom themes. Appearance actions apply live and persist to the active config path when one is available.

Dropping files or folders from a GTK file manager inserts their shell-quoted paths at the cursor, separated by spaces. Remote items use their URI when no local path exists. Lios never appends Enter, and rejects control-bearing or non-UTF-8 local names instead of allowing terminal input controls to escape the quoted path. Empty drops, malformed URI lists, more than 256 items, and generated text over 1 MiB are also rejected.

Closing an idle shell remains immediate. When the terminal owns a detectable foreground or background process, has replaced the shell with `exec`, or was launched with an explicit command, every close path presents one confirmation dialog instead. Process-inspection failures fail closed, repeated close requests cannot stack dialogs, Cancel leaves the process untouched, and a natural child exit dismisses any stale confirmation and closes normally.

## Desktop Launcher

Install or build the binary first, then run `lios --install` to add Lios to the desktop app menu without launching it from another terminal. `lios ---install` is also accepted.

```sh
cargo install --path . --features native
lios --install
```

The command writes `dev.lios.Terminal.desktop` under `$XDG_DATA_HOME/applications` or `~/.local/share/applications` with `Terminal=false` and `Exec` pointing at the exact binary that ran the command. It also installs the app icon from `assets/logo.png` as `dev.lios.Terminal` under the user icon theme and requests a desktop/icon cache refresh when the standard desktop tools are available. Normal GUI startup also makes the packaged icon available to GTK so direct native-feature Cargo launches can resolve the same icon name. Use `lios --uninstall` or `lios ---uninstall` to remove that launcher and icon.

## Resource Policy

- Terminal scrollback is bounded. `scrollback_lines` must be between `0` and `100000`; the default is `1000`.
- Runtime diagnostics show active windows, process RSS, scrollback limit, renderer, terminal identity, image protocol, theme, background image, opacity, overlay state, and config path.
- Wallpaper files are limited to 256 MiB encoded and sane source dimensions. Decoding preserves images already within budget and proportionally scales supported larger sources to at most 8,294,400 pixels, a 4,096-pixel edge, and roughly 32 MiB of logical RGBA texture data. Static non-interlaced PNGs use a row-streaming scaler with a separate 512 MiB source-work ceiling; animated PNGs are unsupported, and an interlaced PNG that would require downscaling is rejected. Oversized JPEGs have an additional 40-megapixel source ceiling; other oversized generic formats fail without falling back to a full decode. Loads are serialized, duplicate requests share one result, replaced views ignore stale completions, and the LRU retains at most four textures and 128 MiB of logical decoded texture data. Decoder work buffers, graphics-driver copies, and allocator retention can temporarily make process RSS higher than these logical texture limits.
- GTK callbacks that can outlive their parent window use weak window references to avoid reference cycles during repeated open/close cycles.
- Segmented preference controls store weak button references internally, avoiding self-cycles between buttons and their click closures.
- No Tokio tasks or channels are used; child processes are owned by VTE and tied to the terminal widget/window lifecycle.
- VTE Sixel rendering is enabled when the installed VTE build supports it. Diagnostics report the effective VTE Sixel setting, but Lios does not export a false image-protocol claim to child processes. Image tools still need to run outside tmux or inside tmux configured to pass image protocols through.
- Internal bridge launchers can set `LIOS_BRIDGE_CONTAINED=1` to keep terminal children in the bridge cgroup. This marker coordinates launch behavior; it is not a security token or trust boundary.

Rust `1.88.0` can ICE while compiling generated GTK binding crates with heavy debug or optimization settings. `Cargo.toml` keeps the workaround scoped to the affected GTK crates. If `cargo install` still crashes while compiling GTK dependencies with a rustc stack trace, retry with a larger compiler stack:

```sh
RUST_MIN_STACK=16777216 cargo install --path . --features native
```

Terminal config commands:

```sh
lios config path
lios config sample
lios config init
lios config init --force
lios config show
lios config themes
lios config validate
lios config theme-template quiet-night --base solarized-dark
lios config set gpu on
lios config set gpu_mode vulkan
lios config set renderer gl
lios config set theme solarized-dark
lios config set opacity 0.88
lios config set background_opacity 0.80
lios config set overlay_color '#7c3aed'
lios config set overlay_opacity 0.18
lios config set random_overlay true
lios config set cursor_match_overlay true
lios config set unified_accent true
lios config set topbar false
lios --install
lios ---install
lios --uninstall
```

Useful keys include `gpu`, `gpu_mode`, `renderer`, `theme`, `font`, `cursor_match_overlay`, `unified_accent`, `opacity`, `background.image`, `background_opacity`, `background_image_opacity`, `overlay_color`, `overlay_opacity`, `random_overlay`, and `topbar`.

## Package

The Cargo package is named `lios` and includes crate metadata for packaging. `Cargo.toml` uses an explicit package include list, so workspace notes such as `.notes.MD` are not part of the published crate. From a repository checkout, run:

```sh
sh audit-package.sh
cargo publish --dry-run --locked --features native
cargo publish --locked
```

The archive audit requires a clean Git commit for a release, compares every
packaged path against an exact allowlist, rejects symlinks and unexpected size
growth, and scans the generated archive for high-confidence credential patterns.

# For socials

Across Lios 0.1.71–0.1.74, we shipped safer, faster terminal UX: OSC 8 links, GPU-cached wallpapers, atomic config/plugin saves, responsive large-scrollback search, bounded async image decoding, safe drag/drop, close guards, hardened titles/bells, and cross-version GTK/VTE CI.

Lios 0.1.85 adds drag-and-drop sidebar ordering and Ctrl+Shift+Page Up/Down session moves. Keyboard moves keep the active terminal and its focus; reordering never restarts shells. Saved layout choices and the original bundled wallpaper, prompt, and startup defaults remain unchanged.