summaryrefslogtreecommitdiff
path: root/include/term
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-15 12:40:44 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-15 12:40:44 +0300
commit7b31d6a05357953c035e2ab05ec117ef748f7798 (patch)
tree26fea99ff05dce6f076b74e35a19c14a53762653 /include/term
parentca69844a243a6e335b0ddafad057f35e89e0a576 (diff)
Reject a scrollback above TERM_SCROLLBACK_MAX
term_new() silently cut a scrollback above 1000000 lines to 1000000. The limit now has a name in term.h, and term_new() returns NULL above it, as it does for the other invalid options. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include/term')
-rw-r--r--include/term/term.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/term/term.h b/include/term/term.h
index 380dfd3..c69e88e 100644
--- a/include/term/term.h
+++ b/include/term/term.h
@@ -40,6 +40,8 @@ struct term_snapshot;
#define TERM_MAX_COLS 65535
/* The history limit when term_options.scrollback is 0. */
#define TERM_SCROLLBACK_DEFAULT 10000
+/* The largest term_options.scrollback. */
+#define TERM_SCROLLBACK_MAX 1000000
/*
* The version of this header. A host compares TERM_VERSION_CODE with
@@ -153,7 +155,8 @@ struct term_callbacks {
/*
* Options for term_new(). An all-zero value is valid. A size component of 0
* selects 80 columns or 24 rows. A negative component, or columns above
- * TERM_MAX_COLS, makes term_new() fail. A negative scrollback fails too.
+ * TERM_MAX_COLS, makes term_new() fail. A scrollback below 0 or above
+ * TERM_SCROLLBACK_MAX fails too.
* cursor_style must be a value of enum term_cursor_style.
*/
struct term_options {