Skip to content

Commit 1d520e7

Browse files
committed
Bring Background (curs_bkgd) and Terminal queries (curs_termattrs) to 100%
Two more groups fully resolved (eight total). curs_bkgd 5/5: bkgd/bkgdset/wbkgd/wbkgdset set a window's background in memory and emit no immediate bytes -> deferred, proven by NCURSES.BKGD.NOOUTPUT; getbkgd is a pure query -> n/a. curs_termattrs 17/17: longname/termname/has_ic/has_il reconstructed on the terminfo substrate (has_ic/has_il derived from the insert/delete caps) and matched against ncurses across 9 terminals (NCURSES.TERMATTRS, admitted_match). termattrs (SCREEN-level mask, 0 without a screen), baudrate/erasechar/killchar (tty/termios state), and curses_version (library identity) have no terminfo-only contract -> n/a, classified with reasons. Overall 97/481 (20.2%): 30 full, 16 partial, 16 scaffold, 4 divergent, 14 deferred, 17 n/a. Two new no-output/query courts. README/gate green.
1 parent 6ef1fcd commit 1d520e7

11 files changed

Lines changed: 422 additions & 15 deletions

File tree

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ clang C inventory joined with the `syn`-extracted Rust inventory and a curated,
3636
validated counterpart map). `cargo xtask check` is the freshness gate -- it
3737
re-renders in memory and fails if a doc drifted, a counterpart points at a
3838
missing Rust symbol, or a cited court has no receipt. CI and the optional
39-
`.githooks/pre-commit` run it on every change. Measured coverage today: **75 /
40-
481 functions (15.6%)** resolved (22 full, 16 partial, 16 scaffold, 4 divergent,
41-
10 deferred, 7 n/a). **Six groups are fully resolved (100%):**
39+
`.githooks/pre-commit` run it on every change. Measured coverage today: **97 /
40+
481 functions (20.2%)** resolved (30 full, 16 partial, 16 scaffold, 4 divergent,
41+
14 deferred, 17 n/a). **Eight groups are fully resolved (100%):**
4242

4343
- **Terminfo & termcap** (`curs_terminfo`/termcap, 33/33) -- the substrate: the
4444
runtime `tigetflag`/`tigetnum`/`tigetstr` (lookup), `tparm` (parameterized
@@ -52,6 +52,12 @@ missing Rust symbol, or a cited court has no receipt. CI and the optional
5252
- **Cursor move & optimizer** (`curs_move`/`mvcur`, 4/4) -- `mvcur` reconstructs
5353
the relative-move strategy; `move`/`wmove` are proven to emit nothing (logical
5454
position, consumed at refresh).
55+
- **Terminal queries** (`curs_termattrs`, 17/17) -- `longname`/`termname`/
56+
`has_ic`/`has_il` reconstructed from terminfo and matched across 9 terminals;
57+
`termattrs`/`baudrate`/`erasechar`/`killchar`/`curses_version` are screen/tty/
58+
identity state (n/a in the terminfo-only substrate).
59+
- **Background** (`curs_bkgd`, 5/5) -- `bkgd`/`bkgdset`/`wbkgd`/`wbkgdset` proven
60+
to emit nothing (deferred to refresh); `getbkgd` is a pure query (n/a).
5561
- **Bell** (`curs_beep`) -- `beep`/`flash` reconstructed to full byte parity.
5662
- **Erase** (`curs_clear`) -- 6 byte producers oracle-pinned, 3 deferred, 1 n/a.
5763
- **Overlap** (`curs_overlay`) -- `overlay`/`overwrite`/`copywin`, all proven to

docs-src/models/parity.model.json

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,74 @@
137137
"NCURSES.MOVE.NOOUTPUT"
138138
],
139139
"note": "Sets the window's logical cursor position; emits no immediate terminal bytes (the position is consumed by a later add/refresh). Proven empty-output."
140+
},
141+
"bkgd": {
142+
"status": "deferred",
143+
"courts": [
144+
"NCURSES.BKGD.NOOUTPUT"
145+
],
146+
"note": "Sets a window's background char+attribute in memory; emits no immediate terminal bytes (shown by a later refresh). Proven empty-output."
147+
},
148+
"bkgdset": {
149+
"status": "deferred",
150+
"courts": [
151+
"NCURSES.BKGD.NOOUTPUT"
152+
],
153+
"note": "Sets a window's background char+attribute in memory; emits no immediate terminal bytes (shown by a later refresh). Proven empty-output."
154+
},
155+
"wbkgd": {
156+
"status": "deferred",
157+
"courts": [
158+
"NCURSES.BKGD.NOOUTPUT"
159+
],
160+
"note": "Sets a window's background char+attribute in memory; emits no immediate terminal bytes (shown by a later refresh). Proven empty-output."
161+
},
162+
"wbkgdset": {
163+
"status": "deferred",
164+
"courts": [
165+
"NCURSES.BKGD.NOOUTPUT"
166+
],
167+
"note": "Sets a window's background char+attribute in memory; emits no immediate terminal bytes (shown by a later refresh). Proven empty-output."
168+
},
169+
"getbkgd": {
170+
"status": "n_a",
171+
"note": "Pure query returning a window's background char+attribute; no terminal-output contract."
172+
},
173+
"termattrs": {
174+
"status": "n_a",
175+
"note": "Supported-video-attributes mask computed at the SCREEN(SP) level (0 without a screen); requires the screen model not present in the terminfo-only substrate."
176+
},
177+
"termattrs_sp": {
178+
"status": "n_a",
179+
"note": "Supported-video-attributes mask computed at the SCREEN(SP) level (0 without a screen); requires the screen model not present in the terminfo-only substrate."
180+
},
181+
"baudrate": {
182+
"status": "n_a",
183+
"note": "Queries the live terminal's tty/termios state (baud / erase / kill char), not terminfo; no terminal-output contract for a byte reconstruction."
184+
},
185+
"baudrate_sp": {
186+
"status": "n_a",
187+
"note": "Queries the live terminal's tty/termios state (baud / erase / kill char), not terminfo; no terminal-output contract for a byte reconstruction."
188+
},
189+
"erasechar": {
190+
"status": "n_a",
191+
"note": "Queries the live terminal's tty/termios state (baud / erase / kill char), not terminfo; no terminal-output contract for a byte reconstruction."
192+
},
193+
"erasechar_sp": {
194+
"status": "n_a",
195+
"note": "Queries the live terminal's tty/termios state (baud / erase / kill char), not terminfo; no terminal-output contract for a byte reconstruction."
196+
},
197+
"killchar": {
198+
"status": "n_a",
199+
"note": "Queries the live terminal's tty/termios state (baud / erase / kill char), not terminfo; no terminal-output contract for a byte reconstruction."
200+
},
201+
"killchar_sp": {
202+
"status": "n_a",
203+
"note": "Queries the live terminal's tty/termios state (baud / erase / kill char), not terminfo; no terminal-output contract for a byte reconstruction."
204+
},
205+
"curses_version": {
206+
"status": "n_a",
207+
"note": "Returns the curses library identity/version string; not a terminal capability and no terminal-output contract."
140208
}
141209
},
142210
"groups": [
@@ -2339,6 +2407,70 @@
23392407
"rust": "screen::single_field_repaint",
23402408
"status": "scaffold",
23412409
"note": "Same single-shape repaint seed as doupdate; the _sp screen-pointer variant is not modelled."
2410+
},
2411+
"longname": {
2412+
"rust": "terminfo::Terminfo::longname",
2413+
"status": "full",
2414+
"courts": [
2415+
"NCURSES.TERMATTRS"
2416+
],
2417+
"note": "Verbose terminal description (last alias); matches ncurses across 9 terminals."
2418+
},
2419+
"longname_sp": {
2420+
"rust": "terminfo::Terminfo::longname",
2421+
"status": "full",
2422+
"courts": [
2423+
"NCURSES.TERMATTRS"
2424+
],
2425+
"note": "Verbose terminal description (last alias); matches ncurses across 9 terminals."
2426+
},
2427+
"termname": {
2428+
"rust": "terminfo::Terminfo::termname",
2429+
"status": "full",
2430+
"courts": [
2431+
"NCURSES.TERMATTRS"
2432+
],
2433+
"note": "Primary terminal name (first alias, <=14 bytes); matches ncurses across 9 terminals."
2434+
},
2435+
"termname_sp": {
2436+
"rust": "terminfo::Terminfo::termname",
2437+
"status": "full",
2438+
"courts": [
2439+
"NCURSES.TERMATTRS"
2440+
],
2441+
"note": "Primary terminal name (first alias, <=14 bytes); matches ncurses across 9 terminals."
2442+
},
2443+
"has_ic": {
2444+
"rust": "terminfo::Terminfo::has_ic",
2445+
"status": "full",
2446+
"courts": [
2447+
"NCURSES.TERMATTRS"
2448+
],
2449+
"note": "Insert-character capability derived from terminfo; matches ncurses across 9 terminals."
2450+
},
2451+
"has_ic_sp": {
2452+
"rust": "terminfo::Terminfo::has_ic",
2453+
"status": "full",
2454+
"courts": [
2455+
"NCURSES.TERMATTRS"
2456+
],
2457+
"note": "Insert-character capability derived from terminfo; matches ncurses across 9 terminals."
2458+
},
2459+
"has_il": {
2460+
"rust": "terminfo::Terminfo::has_il",
2461+
"status": "full",
2462+
"courts": [
2463+
"NCURSES.TERMATTRS"
2464+
],
2465+
"note": "Insert/delete-line capability derived from terminfo; matches ncurses across 9 terminals."
2466+
},
2467+
"has_il_sp": {
2468+
"rust": "terminfo::Terminfo::has_il",
2469+
"status": "full",
2470+
"courts": [
2471+
"NCURSES.TERMATTRS"
2472+
],
2473+
"note": "Insert/delete-line capability derived from terminfo; matches ncurses across 9 terminals."
23422474
}
23432475
}
23442476
}

docs/generated/claim-index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ join, and `cargo xtask check` fails if any cited receipt is missing.
1313

1414
| court | verdict | cited by |
1515
|---|---|---|
16+
| `NCURSES.BKGD.NOOUTPUT` | admitted_match | `bkgd`, `bkgdset`, `wbkgd`, `wbkgdset` |
1617
| `NCURSES.BYTE.FRAME.FULL` | admitted_divergence | `endwin`, `initscr` |
1718
| `NCURSES.CAP.BEL` | admitted_match | `beep`, `beep_sp` |
1819
| `NCURSES.CAP.CLEAR` | admitted_match | `clear`, `wclear` |
@@ -28,6 +29,7 @@ join, and `cargo xtask check` fails if any cited receipt is missing.
2829
| `NCURSES.MOVE.NOOUTPUT` | admitted_match | `move`, `wmove` |
2930
| `NCURSES.OVERLAY.NOOUTPUT` | admitted_match | `copywin`, `overlay`, `overwrite` |
3031
| `NCURSES.REFRESH.NOOUTPUT` | admitted_match | `redrawwin`, `wredrawln` |
32+
| `NCURSES.TERMATTRS` | admitted_match | `has_ic`, `has_ic_sp`, `has_il`, `has_il_sp`, `longname`, `longname_sp`, `termname`, `termname_sp` |
3133
| `NCURSES.TERMCAP` | admitted_divergence | `tgetent`, `tgetent_sp`, `tgetflag`, `tgetflag_sp`, `tgetnum`, `tgetnum_sp`, `tgetstr`, `tgetstr_sp`, `tgoto`, `tgoto_sp` |
3234
| `NCURSES.TERMINFO.ECOLOGY` | admitted_match | `restartterm`, `restartterm_sp`, `setupterm`, `tigetflag`, `tigetflag_sp`, `tigetnum`, `tigetnum_sp`, `tigetstr`, `tigetstr_sp` |
3335
| `NCURSES.TERMINFO.LOOKUP` | admitted_match | `tigetflag`, `tigetflag_sp`, `tigetnum`, `tigetnum_sp`, `tigetstr`, `tigetstr_sp` |

docs/generated/port-parity-functions.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,28 @@ C function's signature, return values, or window semantics -- ncurses-native is
1919
byte-output reconstruction, not a C API. Credit is withheld from every function
2020
that is neither reconstructed nor classified with evidence.
2121

22-
**Overall: 75 / 481 C functions are resolved (15.6%). The other 406 are gaps.**
22+
**Overall: 97 / 481 C functions are resolved (20.2%). The other 384 are gaps.**
2323

2424
Legend: `*` full = every function in the group reconstructed and admitted by a court · `~` partial = some behavior reconstructed with an executable court (byte/terminfo oracle) · `o` scaffold = a byte-producing stand-in exists, not yet pinned by its own court · `!` divergent = a counterpart exists but a court records a measured divergence from the in-repo oracle · `>` deferred = no immediate terminal output; the function's effect is realized later by refresh/doupdate, proven by an empty-output court · `n` n_a = no terminal-output contract (pure query or state); nothing for a byte-output reconstruction to emit · `.` none = no counterpart.
2525

2626
## Per-group coverage
2727

2828
| ncurses API group | fns | resolved | gap | parity % |
2929
|---|---:|---:|---:|---:|
30+
| Background (curs_bkgd) | 5 | 5 | 0 | 100.0 |
3031
| Bell (curs_beep) | 4 | 4 | 0 | 100.0 |
3132
| Cursor move & optimizer (curs_move / mvcur) | 4 | 4 | 0 | 100.0 |
3233
| Erase (curs_clear) | 10 | 10 | 0 | 100.0 |
3334
| Overlap (curs_overlay) | 3 | 3 | 0 | 100.0 |
3435
| Refresh & doupdate (curs_refresh) | 7 | 7 | 0 | 100.0 |
36+
| Terminal queries (curs_termattrs) | 17 | 17 | 0 | 100.0 |
3537
| Terminfo & termcap (curs_terminfo / termcap) | 33 | 33 | 0 | 100.0 |
3638
| Attributes (curs_attr) | 27 | 8 | 19 | 29.6 |
3739
| Screen init & teardown (curs_initscr) | 11 | 2 | 9 | 18.2 |
3840
| Color (curs_color) | 40 | 4 | 36 | 10.0 |
3941
| Add character (curs_addch) | 6 | 0 | 6 | 0.0 |
4042
| Add chstr (curs_addchstr) | 8 | 0 | 8 | 0.0 |
4143
| Add string (curs_addstr) | 8 | 0 | 8 | 0.0 |
42-
| Background (curs_bkgd) | 5 | 0 | 5 | 0.0 |
4344
| Borders & lines (curs_border) | 11 | 0 | 11 | 0.0 |
4445
| Input options & key handling (curs_inopts / util) | 56 | 0 | 56 | 0.0 |
4546
| Input: characters & strings (curs_getch / getstr / scanw) | 22 | 0 | 22 | 0.0 |
@@ -53,7 +54,6 @@ Legend: `*` full = every function in the group reconstructed and admitted by a c
5354
| Screen dump (curs_scr_dump) | 10 | 0 | 10 | 0.0 |
5455
| Scroll & output options (curs_scroll / outopts) | 16 | 0 | 16 | 0.0 |
5556
| Soft labels (curs_slk) | 30 | 0 | 30 | 0.0 |
56-
| Terminal queries (curs_termattrs) | 17 | 0 | 17 | 0.0 |
5757
| Touch & sync (curs_touch) | 11 | 0 | 11 | 0.0 |
5858
| Trace (curs_trace) | 8 | 0 | 8 | 0.0 |
5959
| Window create & manage (curs_window) | 19 | 0 | 19 | 0.0 |
@@ -65,6 +65,14 @@ Every function in a group that has at least one resolution is listed; gaps are
6565
shown explicitly. Groups with zero resolutions are omitted (see the table above
6666
for their totals).
6767

68+
### Background (curs_bkgd) — 5/5 (100.0%)
69+
70+
- `>` `bkgd` (deferred) [NCURSES.BKGD.NOOUTPUT] — Sets a window's background char+attribute in memory; emits no immediate terminal bytes (shown by a later refresh). Proven empty-output.
71+
- `>` `bkgdset` (deferred) [NCURSES.BKGD.NOOUTPUT] — Sets a window's background char+attribute in memory; emits no immediate terminal bytes (shown by a later refresh). Proven empty-output.
72+
- `n` `getbkgd` (n_a) — Pure query returning a window's background char+attribute; no terminal-output contract.
73+
- `>` `wbkgd` (deferred) [NCURSES.BKGD.NOOUTPUT] — Sets a window's background char+attribute in memory; emits no immediate terminal bytes (shown by a later refresh). Proven empty-output.
74+
- `>` `wbkgdset` (deferred) [NCURSES.BKGD.NOOUTPUT] — Sets a window's background char+attribute in memory; emits no immediate terminal bytes (shown by a later refresh). Proven empty-output.
75+
6876
### Bell (curs_beep) — 4/4 (100.0%)
6977

7078
- `*` `beep` (full) → `bell::beep` [NCURSES.CAP.BEL] — Emits the bel capability (xterm: 0x07); a pure output cap with no window state.
@@ -108,6 +116,26 @@ for their totals).
108116
- `>` `wredrawln` (deferred) [NCURSES.REFRESH.NOOUTPUT] — Marks a window/line range for full repaint on the next refresh; emits no immediate terminal bytes (proven empty-output).
109117
- `o` `wrefresh` (scaffold) → `screen::single_field_repaint` — Same single-shape repaint seed; no WINDOW model.
110118

119+
### Terminal queries (curs_termattrs) — 17/17 (100.0%)
120+
121+
- `n` `baudrate` (n_a) — Queries the live terminal's tty/termios state (baud / erase / kill char), not terminfo; no terminal-output contract for a byte reconstruction.
122+
- `n` `baudrate_sp` (n_a) — Queries the live terminal's tty/termios state (baud / erase / kill char), not terminfo; no terminal-output contract for a byte reconstruction.
123+
- `n` `curses_version` (n_a) — Returns the curses library identity/version string; not a terminal capability and no terminal-output contract.
124+
- `n` `erasechar` (n_a) — Queries the live terminal's tty/termios state (baud / erase / kill char), not terminfo; no terminal-output contract for a byte reconstruction.
125+
- `n` `erasechar_sp` (n_a) — Queries the live terminal's tty/termios state (baud / erase / kill char), not terminfo; no terminal-output contract for a byte reconstruction.
126+
- `*` `has_ic` (full) → `terminfo::Terminfo::has_ic` [NCURSES.TERMATTRS] — Insert-character capability derived from terminfo; matches ncurses across 9 terminals.
127+
- `*` `has_ic_sp` (full) → `terminfo::Terminfo::has_ic` [NCURSES.TERMATTRS] — Insert-character capability derived from terminfo; matches ncurses across 9 terminals.
128+
- `*` `has_il` (full) → `terminfo::Terminfo::has_il` [NCURSES.TERMATTRS] — Insert/delete-line capability derived from terminfo; matches ncurses across 9 terminals.
129+
- `*` `has_il_sp` (full) → `terminfo::Terminfo::has_il` [NCURSES.TERMATTRS] — Insert/delete-line capability derived from terminfo; matches ncurses across 9 terminals.
130+
- `n` `killchar` (n_a) — Queries the live terminal's tty/termios state (baud / erase / kill char), not terminfo; no terminal-output contract for a byte reconstruction.
131+
- `n` `killchar_sp` (n_a) — Queries the live terminal's tty/termios state (baud / erase / kill char), not terminfo; no terminal-output contract for a byte reconstruction.
132+
- `*` `longname` (full) → `terminfo::Terminfo::longname` [NCURSES.TERMATTRS] — Verbose terminal description (last alias); matches ncurses across 9 terminals.
133+
- `*` `longname_sp` (full) → `terminfo::Terminfo::longname` [NCURSES.TERMATTRS] — Verbose terminal description (last alias); matches ncurses across 9 terminals.
134+
- `n` `termattrs` (n_a) — Supported-video-attributes mask computed at the SCREEN(SP) level (0 without a screen); requires the screen model not present in the terminfo-only substrate.
135+
- `n` `termattrs_sp` (n_a) — Supported-video-attributes mask computed at the SCREEN(SP) level (0 without a screen); requires the screen model not present in the terminfo-only substrate.
136+
- `*` `termname` (full) → `terminfo::Terminfo::termname` [NCURSES.TERMATTRS] — Primary terminal name (first alias, <=14 bytes); matches ncurses across 9 terminals.
137+
- `*` `termname_sp` (full) → `terminfo::Terminfo::termname` [NCURSES.TERMATTRS] — Primary terminal name (first alias, <=14 bytes); matches ncurses across 9 terminals.
138+
111139
### Terminfo & termcap (curs_terminfo / termcap) — 33/33 (100.0%)
112140

113141
- `n` `del_curterm` (n_a) — Manages/frees the global cur_term; ncurses-native uses owned Terminfo values, so there is no global pointer to set/delete/free and no terminal output to emit.

docs/generated/port-parity.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,28 @@ Legend: `*` full = every function in the group reconstructed and admitted by a c
1919
## Summary
2020

2121
- **C public API functions:** 481 (clang)
22-
- **Functions resolved (counterpart or classified):** 75 / 481 (15.6%)
23-
- **API groups:** 31 (6 fully resolved)
24-
- **Resolutions by status:** full 22, partial 16, scaffold 16, divergent 4, deferred 10, n_a 7
22+
- **Functions resolved (counterpart or classified):** 97 / 481 (20.2%)
23+
- **API groups:** 31 (8 fully resolved)
24+
- **Resolutions by status:** full 30, partial 16, scaffold 16, divergent 4, deferred 14, n_a 17
2525

2626
## Groups
2727

2828
| ncurses API group | C fns | resolved | parity % | role | ncurses-native modules | status |
2929
|---|---:|---:|---:|---|---|---|
30+
| Background (curs_bkgd) | 5 | 5 | 100.0 | rendition || > n |
3031
| Bell (curs_beep) | 4 | 4 | 100.0 | output | `bell` | * |
3132
| Cursor move & optimizer (curs_move / mvcur) | 4 | 4 | 100.0 | cursor | `cursor` | ~ o > |
3233
| Erase (curs_clear) | 10 | 10 | 100.0 | output | `screen` | ~ > n |
3334
| Overlap (curs_overlay) | 3 | 3 | 100.0 | model || > |
3435
| Refresh & doupdate (curs_refresh) | 7 | 7 | 100.0 | screen update | `screen` | o > |
36+
| Terminal queries (curs_termattrs) | 17 | 17 | 100.0 | substrate | `terminfo` | * n |
3537
| Terminfo & termcap (curs_terminfo / termcap) | 33 | 33 | 100.0 | substrate | `terminfo` | * ~ ! n |
3638
| Attributes (curs_attr) | 27 | 8 | 29.6 | rendition | `attr` | o |
3739
| Screen init & teardown (curs_initscr) | 11 | 2 | 18.2 | lifecycle | `term` | ! |
3840
| Color (curs_color) | 40 | 4 | 10.0 | rendition | `color` | ~ o |
3941
| Add character (curs_addch) | 6 | 0 | 0.0 | output || . |
4042
| Add chstr (curs_addchstr) | 8 | 0 | 0.0 | output || . |
4143
| Add string (curs_addstr) | 8 | 0 | 0.0 | output || . |
42-
| Background (curs_bkgd) | 5 | 0 | 0.0 | rendition || . |
4344
| Borders & lines (curs_border) | 11 | 0 | 0.0 | output || . |
4445
| Input options & key handling (curs_inopts / util) | 56 | 0 | 0.0 | input || . |
4546
| Input: characters & strings (curs_getch / getstr / scanw) | 22 | 0 | 0.0 | input || . |
@@ -53,7 +54,6 @@ Legend: `*` full = every function in the group reconstructed and admitted by a c
5354
| Screen dump (curs_scr_dump) | 10 | 0 | 0.0 | model || . |
5455
| Scroll & output options (curs_scroll / outopts) | 16 | 0 | 0.0 | screen update || . |
5556
| Soft labels (curs_slk) | 30 | 0 | 0.0 | addon || . |
56-
| Terminal queries (curs_termattrs) | 17 | 0 | 0.0 | substrate || . |
5757
| Touch & sync (curs_touch) | 11 | 0 | 0.0 | screen update || . |
5858
| Trace (curs_trace) | 8 | 0 | 0.0 | diagnostics || . |
5959
| Window create & manage (curs_window) | 19 | 0 | 0.0 | model || . |

examples/termattrs_dump.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//! Dump the terminfo-derived terminal queries (longname/termname/has_ic/has_il)
2+
//! for a loaded terminal, for the NCURSES.TERMATTRS oracle court.
3+
//! Usage: `cargo run --quiet --example termattrs_dump -- <TERM>`
4+
5+
use ncurses_native::Terminfo;
6+
7+
fn main() {
8+
let term = std::env::args().nth(1).expect("usage: termattrs_dump <TERM>");
9+
let t = Terminfo::load(&term).unwrap_or_else(|e| {
10+
eprintln!("load {term} failed: {e:?}");
11+
std::process::exit(3);
12+
});
13+
println!("longname|{}", t.longname());
14+
println!("termname|{}", t.termname());
15+
println!("has_ic|{}", i32::from(t.has_ic()));
16+
println!("has_il|{}", i32::from(t.has_il()));
17+
}

0 commit comments

Comments
 (0)