# unix-word-unperfect
This is a Unix-host build of `word unperfect` that leaves the DOS/OpenWatcom
port alone. By default it starts the shared WordPerfect-style 80x25 TUI through
the Linux terminal adapter. File, print, export, and fallback line-editor paths
use standard libc `stdio`.
Build:
```sh
make
```
Smoke test:
```sh
make smoke
```
Run the WordPerfect-style Linux TUI:
```sh
./build/unix-word-unperfect
./build/unix-word-unperfect ../wp_c/WP51/LEARN/MEMO.WKB
```
The Linux TUI fits the host terminal at render time. It detects the terminal
size directly, falls back to `COLUMNS` and `LINES` when output is redirected,
centers the classic screen on larger terminals, clips without wrapping on narrow
terminals, and keeps the command/status rows visible on short terminals.
All Unix file prompts and status rows use normal POSIX path syntax such as
`../wp_c/WP51/LEARN/MEMO.WKB` or `/home/user/doc.wp`; the Unix build does not
wrap host paths in simulated DOS drive letters.
Run the libc stdio fallback editor:
```sh
./build/unix-word-unperfect --stdio
```
Other commands:
```sh
./build/unix-word-unperfect --export ../wp_c/WP51/LEARN/MEMO.WKB memo.txt
./build/unix-word-unperfect --print ../wp_c/WP51/LEARN/MEMO.WKB /dev/lp0
./build/unix-word-unperfect --analyze ../wp_c/WP51/LEARN/MEMO.WKB
./build/unix-word-unperfect --roundtrip in.wp out.wp
./build/unix-word-unperfect --new out.wp "Hello"
./build/unix-word-unperfect --append in.wp out.wp "More text"
```
Printer output:
- `--print IN [LPT]` exports document text and writes it to the given LPT
device/file with a final form feed byte.
- If `[LPT]` is omitted, the program uses `WORD_UNPERFECT_LPT` when set, or
`/dev/lp0` by default.
- The `smoke` target writes printer output to `build/fake-lpt0` so it can run
without printer hardware attached.
Scope:
- Uses libc `fopen`, `fread`, `fwrite`, `fclose`, `fgets`, `fputs`, `printf`,
and memory allocation.
- Reuses the existing portable parser, file preservation, text export, analyzer,
editable document model, display buffer, layout renderer, and live TUI
frontend.
- Builds the shared frontend on the non-Watcom Linux path for the TUI.
- Does not build `rev/wp_dos_runtime_adapter.c`, `rev/wp_shell_console.c`, or
`rev/wp_corpus_validator.c`.
- Does not edit the existing DOS port.
License:
Word Unperfect is distributed under the Word Unperfect XT-Emporium License.
It is MIT-like for non-commercial personal, educational, preservation, and
research use. Commercial use requires prior written permission from the
XT-Emporium.com site owner; contact the owner through https://xt-emporium.com/.