Terminal sessions

A terminal session is an interactive shell that DataMind Oda opens for itself and keeps alive between steps, so multi-step work keeps its place: the working folder, exported variables, defined functions and programs left running all stay in the session. This page is the reference for how a session lives: how it starts, when Oda considers it ready, how sends settle, and how it ends.

The actions Oda takes in a session, with their parameters, results and markers, are on Terminal tools. For the in-app view of the same shells, see Terminal sessions.

What a session is

The life of a session

When Oda considers a session ready

Oda settles a send using three kinds of evidence, and the result says which one settled it:

Wait reasonWhat it means
stdin_readThe session took the input and is waiting for more.
inferred_idleThe session went quiet; this suggests the command finished, but it is not proof.
timeoutThe wait reached its limit before the session settled.
session_exitThe shell itself ended, rather than a command finishing.

An idle or timed-out wait never proves that the foreground command exited: the command can still be running when the wait ends.

Output and reads

Sizes, timings and their checks

A session starts on these defaults:

SettingDefault
Shellbash by default; PowerShell can be selected instead
Screen40 rows by 160 columns
Kept output10,000 lines, up to 4 MiB
Largest single read256 KiB
Checks while settlingevery 50 ms
Exact check after the first write150 ms
Silence counted as idle3 seconds, plus a 500 ms grace
Waiting for a send30 seconds
Close grace3 seconds

Confinement and secrets

A session runs inside the chat's access mode, the same way Oda's commands do; the modes are described on Command sandboxing and approvals.

Refusals and failures

Every refusal names the session, the name or the reason involved, so a case is easy to describe when you report it. In plain words:

Background sends

A send can run in the background, so Oda keeps working while the session runs the command:

Questions, answered

Why was an action on a session refused?

An action has to come from the exact chat that opened the session, and it has to name a session that still exists. Another chat's session, an id nothing holds any more, a session that is already closing, and sessions shutting down with the app are refused, each naming what is wrong. The chat that holds the session can still use it; for anything else, Oda opens a new session.

How does Oda know a session is ready for the next input?

Oda follows the shell's own prompt marker: when the verified prompt returns and the shell holds the foreground again, the session is ready. After the first write, one exact reading can show that the input was read. Once a prompt has been seen, three seconds of silence, plus a half-second grace, also settle the session as idle.

Why is a session still busy after I stopped a send?

Stopping a send does not free its place at once. The send keeps the session's single slot until the pending write and the interrupt have both settled, and the next send can start only after that.

What happens to a waiting send when the session closes?

Closing ends the wait: the send settles as a session exit, and the shell with everything running under it ends. The session then reads as closed.

Can I name a session, and why was a name refused?

Yes; a session can carry a display name such as main or gdb. Names are per chat: a name another session in the same chat already uses, or a name that is already being created, is refused. Leaving the name out is always fine.

How long does a terminal session live?

While the app runs and while the chat that opened it lives. A session is not shared with other chats and is not restored after a restart of Oda; when its chat is gone, the session is gone with it. Oda opens a fresh session when it next needs one.

What does it mean when closing a session reports a failure?

The close could not end the shell and its processes cleanly, so Oda reports the failure instead of claiming success; closing many sessions reports how many could not be closed. Ask Oda to close the session again, and keep the message, which names the reason.

Why does session output arrive without colour and screen updates?

A session is made for commands that read and print text. Oda strips control sequences and normalises line endings, so colour codes and cursor movement do not come through, and a program that draws a full-screen interface is outside this design.

Does what a session sets up carry into the next send?

Yes. The working folder, exported variables, defined functions and any program the session left running all persist from one send to the next. Only the end of the session clears them.