MCPcopy Index your code
hub / github.com/REditorSupport/vscode-R / makeTerminalOptions

Function makeTerminalOptions

src/rTerminal.ts:117–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115}
116
117export 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
140export async function createRTerm(preserveshow?: boolean): Promise<boolean> {
141 const termOptions = await makeTerminalOptions();

Callers 1

createRTermFunction · 0.85

Calls 5

getRtermFunction · 0.90
configFunction · 0.90
homeExtDirFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected