daemon: let an embedder give its sessions the xterm-felis terminfo entry #179

Closed
opened 2026-10-18 23:37:02 +09:00 by natsukium · 0 comments
Owner

A program that runs felis_daemon::serve_unix inside its own executable spawns sessions with TERM=xterm-felis, but cannot give them the xterm-felis terminfo entry. The daemon prepends the directory shipped beside its executable (terminfo::shipped_dir: Contents/Resources/terminfo or share/terminfo), and an embedder's executable ships none. On a machine without felis installed, programs in those sessions fail their terminfo lookups: less warns that the terminal is not fully functional, and line editors fall back.

The source, share/terminfo/felis.terminfo, lives outside every crate, so a dependent cannot reach it at build time. adroit, which now serves its sessions from felis_daemon in-process (adroit daemon), keeps a copy of the source, compiles it with tic -x into its state directory at startup, and puts that directory first in each session's TERMINFO_DIRS. The copy drifts whenever the entry changes upstream.

GitHub mirror: https://github.com/felis-terminal/felis/issues/8

Direction

  • Move the entry's source into the felis-daemon package and export it, e.g. pub const TERMINFO_SOURCE: &str = include_str!(…). include_str! of ../../../share/… would not survive cargo publish (#160): the file has to be inside the package. Repoint nix/compile-terminfo.sh, the package definitions, the macOS app bundling, and the default_term_matches_the_shipped_terminfo_entry test at the new path.
  • Add a DaemonCaps field naming the terminfo directory to prepend, defaulting to shipped_dir(). An embedder that compiles the entry somewhere of its own sets it, and the daemon handles TERMINFO_DIRS exactly as it does for the shipped directory (terminfo::list_in), instead of the embedder rewriting each spawn's environment.
  • The daemon does not compile the entry itself: running tic at runtime is the embedder's choice of where to install, not felis's.
  • docs/reference/terminal-identity.md (where the entry comes from for an embedder), docs/reference/workspace.md if the move changes the tree it describes.

Principle check

  • P1: a real consumer (adroit), and #160 already treats in-process embedders as a supported reuse path; felis-daemon gains an outside consumer through this.
A program that runs `felis_daemon::serve_unix` inside its own executable spawns sessions with `TERM=xterm-felis`, but cannot give them the `xterm-felis` terminfo entry. The daemon prepends the directory shipped beside its executable (`terminfo::shipped_dir`: `Contents/Resources/terminfo` or `share/terminfo`), and an embedder's executable ships none. On a machine without felis installed, programs in those sessions fail their terminfo lookups: `less` warns that the terminal is not fully functional, and line editors fall back. The source, `share/terminfo/felis.terminfo`, lives outside every crate, so a dependent cannot reach it at build time. adroit, which now serves its sessions from `felis_daemon` in-process (`adroit daemon`), keeps a copy of the source, compiles it with `tic -x` into its state directory at startup, and puts that directory first in each session's `TERMINFO_DIRS`. The copy drifts whenever the entry changes upstream. GitHub mirror: https://github.com/felis-terminal/felis/issues/8 ## Direction - Move the entry's source into the `felis-daemon` package and export it, e.g. `pub const TERMINFO_SOURCE: &str = include_str!(…)`. `include_str!` of `../../../share/…` would not survive `cargo publish` (#160): the file has to be inside the package. Repoint `nix/compile-terminfo.sh`, the package definitions, the macOS app bundling, and the `default_term_matches_the_shipped_terminfo_entry` test at the new path. - Add a `DaemonCaps` field naming the terminfo directory to prepend, defaulting to `shipped_dir()`. An embedder that compiles the entry somewhere of its own sets it, and the daemon handles `TERMINFO_DIRS` exactly as it does for the shipped directory (`terminfo::list_in`), instead of the embedder rewriting each spawn's environment. - The daemon does not compile the entry itself: running `tic` at runtime is the embedder's choice of where to install, not felis's. - `docs/reference/terminal-identity.md` (where the entry comes from for an embedder), `docs/reference/workspace.md` if the move changes the tree it describes. ## Principle check - P1: a real consumer (adroit), and #160 already treats in-process embedders as a supported reuse path; felis-daemon gains an outside consumer through this.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
felis-terminal/felis#179
No description provided.