Repository navigation
Editing and screen
The white border encloses the whole working screen, or "VRAM". An 80-column, 24-row terminal gives you 78 by 21 editable cells. The border uses two columns and two rows; a command legend uses the bottom row. There is no extra work area hiding above it or off to the right. Output at the bottom scrolls old rows away. Long lines wrap; the wrapped pieces still make one line of Perl.
The legend stays outside VRAM. Type a highlighted label and press Enter:
H opens HELP, L lists the program, Q asks to quit. These are command
spellings, not Ctrl-key bindings. HELP has the complete list. Narrow windows
show fewer labels, keeping Help and Quit first. Below three columns or five
rows, the frame and legend are omitted.
The input loop blinks the cursor every half second using visibility changes. Insert requests a bar shape; overwrite requests a block. Terminal support determines the shape; blinking does not rely on a native blink setting. Exiting restores the default cursor style. Plain mode leaves cursor appearance to the terminal and has no border or legend.
Think of the screen as a sheet of graph paper:
-
Make it smaller: cells on the right and bottom get cut off. AnteREPL
first keeps one separate copy, then crops the screen and prints a warning.
The warning tells you the full terminal size, including the frame and legend,
for example
RECOVER at 80x24for a 78x21 working area. - Make it bigger: you get empty cells. Lost text does not come back. There is no new warning.
-
Want the old sheet back? Enlarge to at least the size in the warning
and type
RECOVER. The saved sheet replaces the current screen. It does not run anything or merge changes made after shrinking.
The saved copy is an inactive bank. Cursor keys cannot enter it, and Enter
cannot execute text from it. RECOVER refuses while the window is too small.
After a successful recovery, the bank is empty. CLS also empties it.
Dragging a window edge may cause many resize events. We keep the first unclaimed copy through those events, so it is not replaced by already-cut text. There is one copy, not a resize history. It is not saved to disk. Growing alone never restores it. Ordinary output scrolling does not create a bank.
The warning appears after the size changes, without a yes/no question; printing it may scroll more rows away. Size changes are detected while waiting for input, without needing a keypress. Running Perl must print or return control before the screen refreshes.
Your numbered program is a separate notebook. Resizing, scrolling, clearing
the screen, and recovering a screen do not change its source or live variables,
functions, or environment. LIST copies source from the notebook onto the
screen. SAVE writes that source to a file. EDIT opens the notebook.
An input entry that loses some text cannot run as a partial command. Re-enter
it, recover an intact screen, or use EDIT for source larger than the screen.
Use LIST PAUSE, a line range, or the paged HELP to read longer material.
PageUp and Ctrl-Home only move inside the visible area.
The C64's character screen had 40 columns and 25 rows. Its screen editor let
you move into displayed text, change it, and press Return to submit the line.
That physical screen is the inspiration here; the numbered program is stored
separately. AnteREPL follows the size of your terminal instead of fixing it at
40 by 25. Window resizing and RECOVER are additions for a modern terminal.
Sources: Commodore's User's Guide and Programmer's Reference Guide, screen editor.
- Type
LIST. - Move up to the row you want to change.
- Edit the Perl after its line number.
- Press Enter on that row.
- Type
RUNto try the updated program.
Typing inserts by default, including when you move up to edit an earlier row. Press Insert to toggle overwrite mode. LIST's alignment padding does not become extra source indentation when you resubmit a listed row.
You can edit other output too. Enter submits its text using the same command rules as fresh input. Be deliberate about which row you submit.
Move up to an earlier command, edit it, and press Enter. Its result replaces
the previous output immediately below that entry. For example, change
say triple 14 to say triple 3 and the 42 underneath becomes 9.
Repeated reruns do not accumulate result lines at the bottom.
Shorter results remove leftover old output; a silent rerun removes its old result entirely. Later entries and their output remain intact while they fit, without an added blank spacer. The cursor stays immediately below the new result, at the start of the following entry if one exists. Esc or Ctrl-End takes you to a fresh row at the bottom. Blank lines deliberately printed by Perl remain.
For multiline entries, output goes below the whole group, even when you submit from the middle. Errors, LIST output, and program input prompts use the same placement. This only replaces displayed results: executing Perl again still repeats its side effects. Plain mode is unchanged.
Type CLS. The interior becomes blank and the cursor returns to its top left.
The border and command legend remain visible and cannot be edited or submitted.
The numbered program, live Perl variables, %ENV, AUTO settings,
save filename, unsaved status, and source undo are all preserved.
10 say "still here"
CLS
LIST
10 say "still here";
RUN
still here
CLS also forgets the inactive resize bank, so RECOVER cannot undo it.
Use LIST to display your program again. CLEAR/NEW erase the program;
Ctrl-L redraws the existing display. In plain mode, CLS clears an ANSI-capable
terminal; it produces no output when redirected, piped, or using TERM=dumb.
| Command | Where new source goes |
|---|---|
AUTO |
Start at 5, or 5 beyond the highest existing number; step by 5 |
AUTO 100 |
Start at 100; step by 5 |
AUTO 100 20 |
Start at 100; step by 20 |
AUTO OFF |
Return to immediate execution |
AUTO ECHO ON / AUTO ECHO OFF
|
Enable/disable numbered copies after storing; default OFF |
Occupied numbers are skipped. AUTO does not silently overwrite them. To
replace an existing line, submit an explicitly numbered entry. STATUS
shows the next automatic number and increment.
AUTO stores quietly by default: your input stays visible, but no second,
numbered copy is printed. LIST shows the assigned numbers. AUTO ECHO ON
enables those copies, and AUTO ECHO OFF disables them. This session preference
does not start or stop AUTO and survives leaving and re-entering AUTO.
Blank input does nothing. Commands such as LIST, RUN, EDIT, and SAVE
still work while AUTO is active. EVAL say "now" explicitly executes Perl
without storing it. AUTO OFF works as a new command; if a multiline entry
is unfinished, Ctrl-C or Ctrl-D cancels it and ends AUTO, retaining completed
stored lines. Ctrl-D leaves AnteREPL running while AUTO is active. In plain
terminal mode, use Ctrl-D on an empty physical input line.
Single-line statements get an implicit final semicolon. An entry spanning several rows keeps its literal syntax and needs its own terminator:
AUTO
$config = {
retries => 3,
names => [qw(Alice Bob)],
};
AUTO OFF
The completed block is stored as four numbered physical lines and is one UNDO operation. Bracketed multiline paste also waits for Enter and stores the complete pasted entry together.
For exact single-line input, use 10: source or, during AUTO, : source.
This bypasses both semicolon insertion and continuation. It is useful for
heredoc content, POD, and other source whose punctuation must remain exact.
LIST
LIST 10
LIST 10-50
LIST 10-
LIST -50
LIST10-50
LIST SLOW
LIST 10-500 PAUSE
Ranges include both endpoints. Spaces around the hyphen are accepted.
Long listings scroll row by row. SLOW starts at about four lines per second;
normal controlled output is about 33. PAUSE stops after each screenful.
While a controlled listing is running:
| Key | Action |
|---|---|
| Space | Pause or resume |
| S | Switch slow/normal speed |
| Enter | Advance one row, then stay paused |
| Q, Esc, Ctrl-C | Stop listing |
| Other typing or cursor movement | Stop LIST and pass the key to screen editing |
In plain mode or a pipe, LIST prints the entire requested range without delays or key reads. Short normal listings complete immediately.
| Key | Action |
|---|---|
| Arrows | Move through screen text |
| Left at row start | Move to the end of the previous row; stop at the visible top row |
| Enter | Submit selected row or its grouped multiline entry |
| Shift+Enter / Ctrl-N | Insert newline at cursor without submitting; Shift+Enter requires a distinct key sequence |
| Insert | Toggle insert/overwrite; insertion is the default |
| Backspace / Delete | Remove characters |
| Tab | Insert spaces to the next four-column tab stop |
| Home / End | Start/end of current row |
| PageUp / PageDown | Move within visible screen rows |
| Esc / Ctrl-End | Move to a fresh blank row at the bottom |
| Ctrl-Home | Move to the visible top row |
| Ctrl-U | Clear current row |
| Ctrl-L | Redraw |
| Ctrl-C | Cancel entry/end AUTO or interrupt Perl; show QUIT/QUIT!/Ctrl-D exit guidance |
| Ctrl-D | End AUTO/cancel unfinished input; outside AUTO, exit only if source is saved |
The screen retains only rows that fit the terminal. Long rows wrap at its
width. Left crosses row boundaries one at a time, including empty rows.
Wide or combining Unicode characters can misalign the cursor; the editor
currently counts one cell per character.
The screen is not saved between sessions; use SAVE for program source.
Move to the insertion point and press Shift+Enter or Ctrl-N. The row splits at the cursor, and both halves remain part of the same multiline entry. At the start or end of a row, this makes room for another line. It works even when the block is already complete, without running it. Enter still submits the whole group once its braces are closed, including from a row in the middle. Insert/overwrite mode continues to control subsequent typing.
Some terminals send ordinary Enter for Shift+Enter, making them impossible
for the app to distinguish. Use Ctrl-N, or configure Shift+Enter to send
ESC [ 13 ; 2 u (CSI-u) or ESC [ 27 ; 2 ; 13 ~ (xterm), without the spaces.
AnteREPL recognizes these sequences but does not enable a terminal-wide keyboard
protocol. These editing keys apply to screen mode, not --plain or a running
program's STDIN input.