()
| 115 | } |
| 116 | |
| 117 | export async function makeTerminalOptions(): Promise<vscode.TerminalOptions> { |
| 118 | const workspaceFolderPath = getCurrentWorkspaceFolder()?.uri.fsPath; |
| 119 | const termPath = await getRterm(); |
| 120 | const shellArgs: string[] = config().get<string[]>('rterm.option')?.map(util.substituteVariables) || []; |
| 121 | const termOptions: vscode.TerminalOptions = { |
| 122 | name: 'R Interactive', |
| 123 | shellPath: termPath, |
| 124 | shellArgs: shellArgs, |
| 125 | cwd: workspaceFolderPath, |
| 126 | }; |
| 127 | const newRprofile = extensionContext.asAbsolutePath(path.join('R', 'session', 'profile.R')); |
| 128 | const initR = extensionContext.asAbsolutePath(path.join('R', 'session','init.R')); |
| 129 | if (config().get<boolean>('sessionWatcher')) { |
| 130 | termOptions.env = { |
| 131 | R_PROFILE_USER_OLD: process.env.R_PROFILE_USER, |
| 132 | R_PROFILE_USER: newRprofile, |
| 133 | VSCODE_INIT_R: initR, |
| 134 | VSCODE_WATCHER_DIR: homeExtDir() |
| 135 | }; |
| 136 | } |
| 137 | return termOptions; |
| 138 | } |
| 139 | |
| 140 | export async function createRTerm(preserveshow?: boolean): Promise<boolean> { |
| 141 | const termOptions = await makeTerminalOptions(); |
no test coverage detected