SCUA

News

Asking the user a question

August 20, 2026

SCUA can prompt someone and read what they type back. That is what an installer needs, or a CLI tool, or anything that asks before it deletes.

sys.readline() reads a line. sys.readpassword() reads one without echoing it, for a password prompt.

import sys

sys.write("Your name: ")
let name = sys.readline()
print(`hello, {name}`)

Both need the new --allow-tty grant. That follows the same rule as the rest of SCUA's I/O: the terminal is where a person types secrets, so reading it is a capability a host hands over, not something every script holds by default. Without the grant the names do not exist, and the compiler says which one you were missing and how to grant it. An actor never inherits it either, so spawning a partition is not a way around the sandbox.

Both readers return nil at the end of input. Guard for it and the same script works three ways: someone typing at a keyboard, input piped in from another program, and a run with no terminal attached at all. That last one is how CI invokes things, and a reader that hangs there is the bug you would hit first.

Two smaller things. Waiting for input does not freeze the program, so host timers keep running while the prompt sits there. And if you paste a username and password together at the first prompt, the terminal has already displayed the password before the secret read begins. No program can un-display that, so SCUA throws the pasted-ahead text away and asks again rather than accepting a value that was shown on screen.