MCPcopy Create free account
hub / github.com/jetify-com/devbox / updateVSCodeConf

Function updateVSCodeConf

vscode-extension/src/devbox.ts:108–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106}
107
108function updateVSCodeConf() {
109 if (process.platform === 'darwin') {
110 const shell = process.env["SHELL"] ?? "/bin/zsh";
111 const shellArgsMap = (shellType: string) => {
112 switch (shellType) {
113 case "fish":
114 // We special case fish here because fish's `fish_add_path` function
115 // tends to prepend to PATH by default, hence sourcing the fish config after
116 // vscode reopens in devbox environment, overwrites devbox packages and
117 // might cause confusion for users as to why their system installed packages
118 // show up when they type for example `which go` as opposed to the packages
119 // installed by devbox.
120 return ["--no-config"];
121 default:
122 return [];
123 }
124 };
125 const shellTypeSlices = shell.split("/");
126 const shellType = shellTypeSlices[shellTypeSlices.length - 1];
127 shellArgsMap(shellType);
128 const devboxCompatibleShell = {
129 "devboxCompatibleShell": {
130 "path": shell,
131 "args": shellArgsMap(shellType)
132 }
133 };
134
135 workspace.getConfiguration().update(
136 'terminal.integrated.profiles.osx',
137 devboxCompatibleShell,
138 ConfigurationTarget.Workspace
139 );
140 workspace.getConfiguration().update(
141 'terminal.integrated.defaultProfile.osx',
142 'devboxCompatibleShell',
143 ConfigurationTarget.Workspace
144 );
145 }
146}
147
148async function logToFile(dotDevboxPath: Uri, message: string) {
149 // only print to log file if debug mode config is set to true

Callers 1

devboxReopenFunction · 0.85

Calls 1

shellArgsMapFunction · 0.85

Tested by

no test coverage detected