Send text to an existing terminal.

terminalSend(id, text)

Arguments

id

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

text

Character vector containing text to be inserted.

Note

The terminalSend function was added in version 1.1.350 of RStudio.

Examples

if (FALSE) { termId <- rstudioapi::terminalCreate() rstudioapi::terminalSend(termId, 'ls -l\n') }