Terminal tools

DataMind Oda works in a terminal session through six tools: open, send, read, signal, close and list. This page is the reference for what each tool takes, what it returns and how its results are bounded.

How a session lives between calls, and what a wait or a refusal means, is on Terminal sessions. For the same calls written for the reader, see Terminal tools.

The six tools

Parameters

Results and markers

Every result is text. A result longer than the size ceiling is cut at a character boundary and marked [output truncated]; the earlier part is kept.

MarkerWhat it means
(no startup output)The session started with nothing to show yet.
(no new output)The send settled with nothing new; output you already read is not repeated.
[wait: <reason>]Why the wait ended; the four reasons are explained on Terminal sessions.
[session: running]The session was still open after the wait.
[session: exited code=<code> signal=<signal>]The shell ended during the wait; the note carries its exit code, the signal that ended it, or null where there is none.
[output truncated]The result was cut to fit the ceiling; the earlier part is kept.
(no retained output)A read found nothing kept.
[lines: <first>-<last> of <total>]Which lines of the kept output a read returned, and how many lines are kept in all.
(no terminal sessions)The list found no sessions Oda holds.

Sends in the background

Limits and configuration

Refusals

In the chat

Questions, answered

How do I turn background terminal sends off?

Background sending is on by default. Where the app is configured to turn it off, run_in_background is not offered on the send tool, and a call that asks for it anyway is refused. A build without background job support refuses background sends the same way.

How large can a terminal result be?

256 KiB (262,144 bytes) by default. The smallest value the app accepts is 64 bytes. A result over the ceiling is cut at a character boundary and marked [output truncated], keeping the earlier part.

How do I send input without pressing Enter?

Set submit to false on the send. The text is then written alone, which is what control characters and incomplete input in an interactive program need; by default the text ends with Enter.

What does delivered <signal> to foreground process group <id> mean?

It reports where the signal landed: signals go to what is running in the session, and the note names that process group and its id.

Why is a background send's output empty before it starts?

The job's reader binds when the send starts, so a read taken before that comes back empty rather than failing. Once the send is under way, each read continues from where the previous one stopped, so nothing is shown twice. See Background runs and jobs.

What happens when a terminal call runs outside a chat?

It is refused: every terminal call needs an initiating chat to belong to, and nothing runs without one.

How do terminal calls appear in the chat?

A foreground send appears as a terminal card; the other calls appear as generic tool cards titled Open terminal ..., Read terminal ..., Signal terminal ..., Close terminal ... and List terminal sessions. A background send is titled Send to terminal ... in background.

Do terminal results stay in the chat history?

Yes. A result stays in the chat's history like any other tool result until the chat compacts; see Chat compaction.

How does Oda see every session it holds?

With terminal_list, which returns one line per session: the id, the name in parentheses when set, the type in brackets, the status, and the process id when there is one. With none held, it returns (no terminal sessions).