2026-12-01 21:51:17 +00:00
2023-10-02 16:35:42 -07:00
2024-05-13 08:29:36 -07:00
2025-02-12 09:43:36 -07:00
2025-02-12 09:43:36 -07:00
2025-02-12 09:43:36 -07:00
2025-02-12 09:43:36 -07:00
2025-02-12 09:43:36 -07:00
2025-02-12 09:43:36 -07:00
2025-02-12 09:43:36 -07:00
2025-02-12 09:43:36 -07:00
2025-02-12 09:43:36 -07:00
2022-12-07 12:09:06 -08:00
2026-06-06 08:30:00 +01:00
2024-05-13 08:29:36 -07:00
2025-02-07 13:08:01 -07:00

LLeMbas TTY

A terminal that is also an agent. LLeMbas TTY is a fork of WezTerm with LLeMbas built in. By default it is an ordinary terminal: nothing is started, nothing of a pane is read and nothing leaves the machine until you press one of the keys below.

The agent is the LLeMbas CLI (lembas), unchanged; the package carries a verified copy beside the terminal. It logs in to your own LLeMbas server and uses that server's models.

State: 1.0.0-beta.1, not released yet. The terminal's side described here is written and tested without a terminal; the first builds come from CI. The parts that need the LLeMbas CLI need one that knows about terminals (2.0.0-beta.18 or newer); with an older one the terminal says so in words. Version in VERSION, changes in CHANGELOG.md. MIT, like WezTerm — see LICENSE.md.

What it adds

Key Command palette (Ctrl+Shift+P) What it does
Ctrl+Shift+A LLeMbas: ask the model A one-line prompt. Your question goes to LLeMbas with the terminal context of the pane you were in (below). If the tab has a LLeMbas pane it is asked there; otherwise one opens to the right, in the same directory.
LLeMbas: ask about this screen The same, with what is visible on the screen instead of the last commands — also from a full-screen program.
Ctrl+Shift+S LLeMbas: new session here Starts lembas beside the pane, in its directory.
Ctrl+Shift+O LLeMbas: resume a session A list of your sessions to pick from.
Ctrl+Shift+D LLeMbas: toggle side display Shows or hides the session's side display.
Ctrl+Shift+H LLeMbas: private pane on/off Marks the pane private: nothing of it is ever passed on.
LLeMbas: log in Runs lembas login.
  • Session bar. When the pane you are in runs LLeMbas, the right of the tab bar shows its model, mode, state and how full its context is. A tab in which LLeMbas waits for you is marked with ●. With no LLeMbas pane, the bar shows nothing of ours.
  • Prompt autocomplete, off by default: in zsh the rest of the line appears dimmed after the cursor (Right arrow or End takes it), in bash a key (Ctrl+X Ctrl+A) completes the line. See Autocomplete below.
  • Its own everything. LLeMbas TTY installs beside WezTerm and shares nothing with it: its commands are llembas-tty, llembas-tty-gui and llembas-tty-mux-server, its configuration is ~/.config/llembas-tty/llembas-tty.lua (or ~/.llembas-tty.lua), and it neither reads WezTerm's files nor talks to a running WezTerm.

What is passed on, and when

Only when you ask (the two ask entries), and only this:

  • the last 5 commands of that pane with the end of each one's output (200 lines or 16 KiB at most), and the pane's directory and shell. This needs the shell integration (below), which marks where a command and its output begin;
  • without shell integration: the last screenful instead;
  • from a full-screen program (an editor, a pager): only the directory, unless you chose ask about this screen.

Never: a pane you marked private, a pane that is asking for a password, a pane that runs on another machine, the scrollback as a whole, or anything at all while you have not asked. The context is written to a file only you can read, in the terminal's runtime directory; LLeMbas deletes it after reading it and the terminal removes any that are left after ten minutes. What LLeMbas then does with it is the CLI's business and follows its permissions.

The session bar reads what LLeMbas itself tells the terminal about its session. It does not read the pane.

Configuration

With no configuration file, the built-in one applies the layer with its defaults. Your own file — everything WezTerm's configuration can do, see https://wezterm.org/config/files.html — opts in with one line:

local wezterm = require 'wezterm'
local config = wezterm.config_builder()

require('llembas').apply(config, {
  -- every line is optional; these are the defaults
  enabled = true,          -- false: no layer at all
  cli = nil,               -- path of `lembas`; nil: the bundled one, then PATH
  session_bar = true,
  tab_marker = true,
  palette = true,
  bar = { fields = { 'model', 'mode', 'state', 'context' } },
                           -- also: 'session', 'title', 'effort', 'tokens', 'spend'
  keys = {                 -- false turns a key off
    ask = { key = 'A', mods = 'CTRL|SHIFT' },
    new_session = { key = 'S', mods = 'CTRL|SHIFT' },
    resume = { key = 'O', mods = 'CTRL|SHIFT' },
    toggle_display = { key = 'D', mods = 'CTRL|SHIFT' },
    private = { key = 'H', mods = 'CTRL|SHIFT' },
  },
  split = { direction = 'Right', size = 0.45 },
  new_session_in = 'split',  -- or 'tab'
  context = {
    enabled = true,        -- false: questions go alone, nothing of the pane
    blocks = 5,            -- commands passed on (at most 20)
    output_lines = 200,    -- of each command's output, from its end
    output_bytes = 16384,
    alt_screen = false,    -- true: also the screen of a full-screen program
  },
  autocomplete = false,
})

return config

To have none of it: leave the line out of your file, pass { enabled = false }, or start with llembas-tty -n.

If your file sets its own right status or tab titles, turn session_bar or tab_marker off, or call apply after your own handlers: the terminal uses the first tab-title handler it was given.

Shell integration

The package installs it for bash through /etc/profile.d. For zsh, or after unpacking the tarball, add to ~/.zshrc or ~/.bashrc:

[ -n "$LLEMBAS_TTY" ] && . /usr/share/llembas-tty/shell/llembas-tty.sh

It marks commands and their output for the terminal (WezTerm's own integration script, OSC 133 and OSC 7) and does nothing outside LLeMbas TTY.

Autocomplete

Set autocomplete = true in the options above; new panes then have LLEMBAS_TTY_AUTOCOMPLETE=1 and the shell integration turns completion on. The line you are typing is sent to lembas complete after a short pause — never an empty line, never a line that starts with a space, never outside LLeMbas TTY. What comes back is put on the line as text; nothing runs until you press Enter. If zsh-autosuggestions is loaded, ours stays off.


Wez's Terminal

WezTerm Icon A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust

User facing docs and guide at: https://wezterm.org/

Screenshot

Screenshot of wezterm on macOS, running vim

Installation

https://wezterm.org/installation

Getting help

This is a spare time project, so please bear with me. There are a couple of channels for support:

  • You can use the GitHub issue tracker to see if someone else has a similar issue, or to file a new one.
  • Start or join a thread in our GitHub Discussions; if you have general questions or want to chat with other wezterm users, you're welcome here!
  • There is a Matrix room via Element.io for (potentially!) real time discussions.

The GitHub Discussions and Element/Gitter rooms are better suited for questions than bug reports, but don't be afraid to use whichever you are most comfortable using and we'll work it out.

Supporting the Project

If you use and like WezTerm, please consider sponsoring it: your support helps to cover the fees required to maintain the project and to validate the time spent working on it!

Read more about sponsoring.

S
Description
The agentic terminal: a WezTerm fork with LLeMbas built in
Readme MIT
316 MiB
0 Stars 2 Watchers 0 Forks
Languages
Rust 97.7%
Python 1%
Shell 0.9%
Nix 0.2%