Terminal shells and sandboxing

Every terminal session DataMind Oda opens runs a shell on your computer. This page covers which shell that is, how the chat's access mode confines it, and the defaults behind both. For the sessions themselves, see Terminal sessions, and for the actions Oda takes in them, see Terminal tools.

Which shell a session runs

The defaults behind a session

A session starts with these values:

SettingDefaultWhat it covers
Session screen40 rows by 160 columnsThe size the session is created with.
Kept output10,000 lines, up to 4 MiBThe oldest output drops off beyond this.
Largest read256 KiB of textA single read never returns more than this.
Waiting for a send30 secondsAfter this, the wait ends with [wait: timeout].
Checks while settlingevery 50 msHow often Oda looks at the session.
Exact check after the first write150 msOne precise reading taken after the first input.
Quiet counted as idle3 seconds, plus a 500 ms graceA session this quiet is treated as idle.
Close grace3 secondsHow long Oda gives the processes to end before a close can report a failure.

Oda validates these values when the app starts: they must be positive numbers, the read cap cannot be larger than the amount of output a session keeps, and the quiet-time grace cannot be shorter than one check interval.

How the access mode confines a session

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

How Oda waits for a session

How Oda stops and closes a session

Questions, answered

Which shell does a session run?

bash by default; a session can run PowerShell instead. A shell command configured for the app replaces the default.

Why does a session ignore my aliases and prompt settings?

Oda starts the shell without your profile or startup files, so the aliases, prompt and other tweaks from those files are not loaded inside a session.

Why is changing the access mode refused while a session is open?

The mode cannot change while the chat has terminal sessions open or a session that is still starting. Close the open sessions, wait for any that is still being started, then change the mode.

Why can't a session start in the current access mode?

When the mode limits writes, the shell has to start confined. On a computer where the limits cannot be applied to a shell, the session is not started: Oda reports that the mode cannot confine a shell here, and it does not run the shell without limits instead.

How much output does a session keep?

About the last 10,000 lines, up to 4 MiB; older output drops off beyond that. A single read result carries at most 256 KiB of text.

How long does a send wait before it gives up?

Up to 30 seconds. If the session does not settle in that time, the result carries [wait: timeout]. Giving up ends the wait, not the command.

How does Oda stop a command it is running?

Oda delivers a real interrupt (SIGINT) to what is running, after the pending input settles. It does not type Ctrl+C into the session; the interrupt arrives as a signal.

What happens when a session fails to start?

If the shell ends while the session is starting, or never becomes ready in time, Oda reports a startup failure and no session opens. Start a new session; if it keeps failing, ask your DataMind OS administrator.

Does a session inherit the app's credentials?

No. Oda removes its own credentials and secrets from the environment before the shell starts, so they are not present in a session.

Can I run a full-screen program in a session?

Sessions are made for commands that read and print text. A program that draws a full-screen interface is outside that design, so its screen does not come through as it would in a terminal you open yourself.