term: Open a Terminal

Description Usage Arguments Note See Also Examples

View source: R/term.R

Description

Opens a terminal emulator in directory path.

The possibilities to start a terminal are:

“tmux”:

Create a tmux split if the R session runs inside tmux.

“rstudio”:

Create a new RStudio terminal if the R session runs inside RStudio.

“opts”:

If set, use the options “gtfo.terminal.bin” and “gtfo.terminal.args” to open a new terminal or terminal tab.

“default”:

Open one of the hard-coded terminals. See note for details.

The order of the different strategies can be controlled via the option “gtfo.term.order” (default: c("tmux", "rstudio", "opts", "default")).

Usage

1
term(path = getwd())

Arguments

path

[character(1)]
Path. Defaults to the current working directory as reported by getwd.

Note

The default terminal will determined as follows:

Mac OS:

If called from iTerm, start iTerm. Start Terminal otherwise.

Linux:

Try to find the one of terminals in $PATH via Sys.which and open the first one found: kitty, alacritty, urxvt, gnome-terminal, konsole, xfce4-terminal, lxterminal.

Windows:

Start powershell.

See Also

fm to start a file manager and browse to start a browser.

Examples

1
2
3
4
5
6
7
8
## Not run: 
# Terminal in R's working directory
term()

# Terminal in R's tempdir
term(tempdir())

## End(Not run)

mllg/gtfo documentation built on May 23, 2019, 1:24 p.m.