• Ctrl-C while the pause prompt is being printed is lost (getkey() clear

    From Rob Swindell@1:103/705 to GitLab issue in main/sbbs on Fri Oct 30 15:54:48 2026
    open https://gitlab.synchro.net/main/sbbs/-/work_items/1316

    A Ctrl-C that arrives while `sbbs_t::pause()` is printing its "[Hit a key]" prompt is lost: the prompt is left partially displayed and the pause waits for another key instead of aborting.

    ### Cause

    `pause()` (`src/sbbs3/getkey.cpp`) does:

    1. Return early if an abort (`SS_ABORT`) is already pending.
    2. Print the prompt: `bputs(text[Pause])`.
    3. Wait for a key: `ch = getkey(l)`.

    `getkey()` calls `clearabort()` on entry. When Ctrl-C arrives during step 2, the input thread sets `SS_ABORT` and purges the output buffer, so the rest of the prompt is never sent. Step 3 then clears `SS_ABORT`, and the pause waits for another keypress behind the partial prompt. The Ctrl-C has been acted on (output purged) and then forgotten (abort cleared).

    The window is normally tiny, but it gets wide whenever `bputs()` blocks waiting for room in a full output buffer, i.e. with a slow or emulated-speed (DECSCS) terminal whose receive buffers have filled.

    ### Proposed fix

    Check for a pending abort between printing the prompt and waiting for a key, and skip the wait if one is there:

    ```cpp
    ch = (sys_status & SS_ABORT) ? 0 : getkey(l);
    ```

    `pause()`'s existing `aborted` expression already treats `SS_ABORT` as an abort, so the rest is unchanged: the prompt is erased, the attribute restored, and `pause()` returns false.

    Removing `getkey()`'s entry `clearabort()` would also close the remaining few-microsecond window between that check and `getkey()`, but callers rely on `getkey()` discarding a stale abort before waiting (e.g. a prompt right after an aborted listing), so that would be a much broader behavior change.

    `ANSI_Terminal::getxy()` (`src/sbbs3/ansi_terminal.cpp`) has the same pattern: it calls `clearabort()` after sending its cursor position query, so a Ctrl-C pending before the query is discarded. Lower impact.

    ### Reproducing

    Ctrl-C has to land while `bputs()` is blocked, which is hard to hit by hand. A temporary build with a one-second sleep between the `bputs()` and the `getkey()` makes it easy: press Ctrl-C during the sleep. Without the fix the pause waits for another key; with it, the display stops.

    *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)