# gets
Read one line from a channel (defaults to `:stdin`).
## Syntax
[gets]
[gets $target]
## Parameters
- `$target` — (optional) A `%Chan` handle from `open`, or one of the
standard stream keywords `:stdin` / `:stdout` / `:stderr`; defaults to
`:stdin`.
## Examples
echo "Name: " set line [gets] # reads from stdin set chan [open "/tmp/log.txt"] set first [gets $chan] # => first line of the file set second [gets $chan] set eof [gets $chan] # => nil (end of file) [close $chan]
## Returns
The line as a string (without its trailing newline), or `nil` at EOF.
Raw fd numbers are rejected — use a channel handle or a stream keyword.
Note: `[gets]` blocks until a line arrives; on a TTY inside a hosted
app that stalls the panel.
## See Also
`puts`, `open`, `close`, `echo`