run: Run an application

View source: R/app.R

runR Documentation

Run an application

Description

Takes over the terminal (alternate screen, raw keyboard input), runs the event loop until the app calls exit(), and restores the terminal - also when an error occurs or the user interrupts R.

Usage

run(x, ...)

Arguments

x

An App created by app(), or a widget (wrapped in an app).

...

Passed to App$run(), e.g. driver.

Details

When the app stops, its timers, widget timers, workers and animations are cancelled. The same app can be run again, but timers and workers have to be started again (for example from a "mount" handler).

termr apps need a real terminal: run them with Rscript (or an interactive R session) in a terminal such as Windows Terminal, iTerm2 or GNOME Terminal. RStudio's console is not a terminal.

Value

The value passed to app$exit(), invisibly.


termr documentation built on Oct. 21, 2026, 5:13 p.m.