Returns information about RStudio terminal instances.

terminalContext(id)

Arguments

id

The terminal id. The id is obtained from terminalList(), terminalVisible(), terminalCreate(), or terminalExecute().

Value

A list with elements:

handlethe internal handle
captioncaption
titletitle set by the shell
working_dirworking directory
shellshell type
runningis terminal process executing
busyis terminal running a program
exit_codeprocess exit code or NULL
connectionwebsockets or rpc
sequencecreation sequence
lineslines of text in terminal buffer
colscolumns in terminal
rowsrows in terminal
pidprocess id of terminal shell
full_screenfull screen program running

Note

The terminalContext function was added in version 1.1.350 of RStudio.

Examples

if (FALSE) { termId <- rstudioapi::terminalCreate("example", show = FALSE) View(rstudioapi::terminalContext(termId)) }