The terminal library - pf-lang/pipefish GitHub Wiki

The terminal library, as the name suggests, allows input and output from and to the machine that the service is running on. If you're just using your service as a desktop app, this is perfectly harmless. But if it's a public-facing service, the results would be extremely annoying for everyone. For ordinary output, you should instead use the built-in command post (x any?) to Output().

Types

  • Keyboard = struct(prompt string)
  • Screen = struct()

Commands

post (x any?) to (s Screen)

Posts the value to the terminal the service is running on.

get (x ref) from (k Keyboard)

Gets input from the keyboard of the terminal the service is running on, using k[prompt] as a prompt.

get (x ref) from masked (k Keyboard)

Gets masked input from the keyboard of the terminal the service is running on, using k[prompt] as a prompt.