terminalBusy: Is Terminal Busy

Description Usage Arguments Value Note Examples

Description

Are terminals reporting that they are busy?

Usage

1

Arguments

id

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

Value

a boolean

Note

The terminalBusy function was added in version 1.1.350 of RStudio.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# create a hidden terminal and run a lengthy command
termId <- rstudioapi::terminalCreate(show = FALSE)
rstudioapi::terminalSend(termId, "sleep 5\n")

# wait until a busy terminal is finished
while (rstudioapi::terminalBusy(termId)) {
  Sys.sleep(0.1)
}
print("Terminal available")

## End(Not run)

rstudio/rstudioapi documentation built on June 7, 2019, 3:43 p.m.