diff options
| author | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-25 21:54:08 -0600 |
|---|---|---|
| committer | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-25 21:54:08 -0600 |
| commit | 87c6a0f8f822c57b4f63bc8bb099a33307871414 (patch) | |
| tree | badd8a2f1485c15280cdf7c64a167b9ffd0e47c5 /src/interact.h | |
| parent | c980daddaa17460a65fe1ce7511b680279381dc1 (diff) | |
| download | zash-editor/one-editor.tar.gz | |
interactive: one editor, no libraryeditor/one-editor
libedit was a compile-time alternative (`make EDIT=libedit`). It goes:
FreeBSD and NetBSD `sh` use it because it is in their base system, which
is not the case on z/OS, and it cost about a third of a millisecond to
reach the prompt -- three more shared libraries, `el_init()`, an
`~/.editrc` read and a copy of the history -- for the same cost per key.
What it bought was `~/.editrc` bindings and a kill ring; `bind` and the
built-in editor's own bindings cover the keys, and a second editor meant
a second build mode and a second set of interactive expectations, with
seven tests skipping under it.
Everything that existed only to serve two editors goes with it: the
`EDIT` switch and the two `edit_$(EDIT)` paths in the makefile, the
`$ZASH_EDITOR` variable the tests used to skip, the skip guards in
`tests/linux/`, the NUL stripping in `ptydrive.py` that libedit's redraw
needed, and the parallel paragraphs in README.md, DESIGN.md,
bench/README.md and the two website pages. `bench/README.md` keeps the
measurement, since that is why the decision is written in DESIGN.md.
Checked on Linux (97 passed, 1 skipped, the one known local failure in
linux/i-dscomplete) and on z/OS (64 passed, 3 skipped, 0 failed, plus the
EBCDIC build).
Diffstat (limited to 'src/interact.h')
| -rw-r--r-- | src/interact.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/interact.h b/src/interact.h index 7894480..7a649c5 100644 --- a/src/interact.h +++ b/src/interact.h @@ -29,23 +29,15 @@ int hist_count(void); const char *hist_entry(int index); void hist_save(void); -/* ---- the line editor (edit_builtin.c or edit_libedit.c) -------------- */ +/* ---- the line editor (edit_builtin.c) -------------------------------- */ /* - * Both editors define these two functions, where they are documented. * edit_usable() says whether lines can be edited on this terminal; * edit_readline() reads one line and returns it without its newline, in * storage it owns, or nullptr at end of input. */ bool edit_usable(void); char *edit_readline(const char *prompt, size_t *len); -/** - * @brief Which editor is linked in: "builtin" or "libedit". - * - * It is the value of `$ZASH_EDITOR`, and the tests use it to skip what - * only one of the two editors does. - */ -extern const char edit_name[]; /* * `bind`, in the notation of the BSD shells: edit_bind() records one |
