Skip to content

Make waitable input sources explicit: terminal input, pipes, and portable readiness #18

Description

@isomorphisms

A historical curses/PDCurses discussion exposed a useful systems/API warning that belongs in Ish/Grease even if the original programmer simply missed an available hook.

In the 2011 suckless discussion, Rafa reported that he wanted to wait for keyboard input and a command pipe together, but could not find the descriptor corresponding to curses input. On the PDCurses X11 backend there was in fact a PDC_get_input_fd() hook intended for select(), while other backends did not necessarily represent input as a normal POSIX file descriptor. That makes this useful as a canary for two separate problems:

  1. discoverability/documentation — a program should be able to discover what it is supposed to wait on without reverse-engineering the terminal library; and
  2. portability/modeling — not every input source is necessarily representable as a Unix fd, so an Ish-level abstraction should not accidentally equate "waitable input" with "integer file descriptor" unless that is deliberately the contract.

For Ish/Grease, keep eyes on the shell/event-waiting surface around select, poll, pipes, terminal input, process/event sources, and any future typed API. The user-facing question should be easy to answer: what objects can I wait on together, and how do I obtain the waitable object for terminal/input sources?

Do not treat the historical report as proof that select() itself is broken. The point is to preserve awareness of the API/documentation/portability failure mode.

Cross-reference: isomorphisms/icurses#1, where the curses replacement discussion and PDCurses/libr_cons source investigation are being collected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions