How a tool or a probe sees an agent process, its terminal, its open files
and its folder, on each OS. The column "Measured" says where the row was
measured. "Probe" means that a probe uses it and CI runs that probe on a
runner with no agent session.
Linux
Question
Command
Measured
Processes and parents
ps -axo pid=,ppid=,tty=,args=; /proc/<pid>/stat field 4
Terminal: tell application "Terminal" to get tty of every tab of every window; iTerm2: tty of every session of every tab of every window. The first call can open an Automation dialog.
A pseudo console (ConPTY) through pywinpty 3.1.2, read with pyte 0.8.2 (scenarios/conpty.py). The console host is the OpenConsole.exe of the wheel, a child of the driver, not of the agent.
Most agents read USERPROFILE. Codex CLI ignores USERPROFILE and HOME and writes to the profile of the account, but it uses CODEX_HOME when it is set. Open Interpreter, Every Code, Junie CLI and Kiro CLI also write to the profile of the account. Cursor CLI takes the account name from Windows, not from USERNAME.
A console process has no tty. The parent chain shows the terminal program: WindowsTerminal, OpenConsole, conhost, Code, a JetBrains IDE.
probe (no session)
Environment of another process
No route without extra tools.
not measured
psmux (tmux for Windows)
psmux ls, psmux list-panes -a. Under PowerShell, send-keys ... C-m sends a literal ^M; Enter works.
aw (psmux 3.4.0)
Codex CLI keys
Tab sends a message. Enter and C-j add a new line.
aw (Codex 0.164.0)
Install folder and version
Get-Command <cmd> -All lists an npm agent as <cmd>.ps1, <cmd>.cmd and <cmd>. The version is in node_modules\<package>\package.json below the npm prefix (C:\npm\prefix on the runners). The file version of an .exe is not always the agent version.