history

history manages two separate layers. Browser command history stores only entered commands in localStorage. Optional persistent history stores commands and safe textual command output in .lil.log.php so the web terminal can restore its transcript after page navigation or a new browser window.

SystemVersion 1.2.3Stable
lil-terminal

Overview

history separates browser command history from the optional persistent terminal transcript, so commands can be repeated quickly without forcing cross-page output storage.

Three kinds of remembered state

Browser command history, the last textual result in the PHP session and the optional persistent transcript are independent. Keep persistent recording off unless restoring terminal output across pages is worth storing that output on the server.

Syntax

lil-terminal
history [-c|-o|-l [on|off|status|clear]]

Reference

history

show numbered browser command history

history -c

clear browser command history

history -o

show the last terminal result stored in the current PHP session

history -l

show the persistent terminal transcript

history -l on

enable persistent command and output recording

history -l off

disable persistent recording without deleting the transcript

history -l status

show whether persistent recording is enabled

history -l clear

delete the persistent transcript

Persistence

Persistent recording is disabled by default. Its enabled state is stored in the history namespace of .lil.key. The transcript is stored separately in .lil.log.php as bounded newline-delimited JSON. The file starts with an executable PHP 404 guard, is limited to 400 entries and 1 MiB, rejects symbolic links and is written atomically with restrictive permissions.

Web terminal

When persistent history is enabled, a web-enabled core restores the latest transcript when its floating terminal window is opened on another page. The red window control clears the persistent transcript and destroys the current browser view; the yellow control hides the same iframe and therefore preserves its live DOM state.

Privacy

Terminal output can contain paths, database rows, environment values or other project data. Enable persistent history only when server-side storage of that output is appropriate. Password and hidden secret prompt values are never passed to this recorder.

Last result

history -o reads the most recent textual result retained by the current lil core in the PHP session. It does not require persistent transcript recording. Combine it with the core output operator to save the last result, for example history -o > history.log to append or history -o > history.log -r to replace the file. The terminal shortcuts use the automatic form @history -o so a missing Base History module can be installed silently.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Show numbered browser command history

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install history
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install history -m
Exact public version

Install exactly this published version.

install history -v 1.2.3
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade history
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install history -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Show numbered browser command history
pwd | cd \sandbox | history
/home/account/public_html

001  pwd
002  cd \sandbox
003  history
Show the last terminal result stored in the current PHP session
history -o
001  help
002  pwd
003  history
Show the last terminal result stored in the current PHP session
history -o > history.log
001  help
002  pwd
003  history
Show the last terminal result stored in the current PHP session
history -o > history.log -r
001  help
002  pwd
003  history
Enable persistent command and output recording
history -l on
persistent transcript  on
Show whether persistent recording is enabled
history -l status
persistent transcript  on
file                   .lil.log.php
Delete the persistent transcript
history -l clear
001  pwd
002  cd sandbox
003  history
Clear browser command history
history -c
browser command history cleared
Show the persistent terminal transcript
history -l maybe
?

Related documentation

Current public release

v1.2.32026-08-14

Separated history layers

Plain @clear no longer removes the persistent transcript. Persistent recording is deleted only by an explicit @history -l clear or @clear -H action.