Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions vscode-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to the "devbox" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [0.1.9]

- Added `devbox.runInitHookOnReopen` setting (off by default) to run the project's `init_hook` and include its environment variables when reopening in the Devbox environment.

## [0.1.8]

- Added support "Reopen in Devbox" feature for Windows with WSL
Expand Down
4 changes: 4 additions & 0 deletions vscode-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ No need to take any action for this feature. When writing a devbox.json, if this

---

### Run init_hook on Reopen

By default, `"Devbox: Reopen in Devbox Shell environment"` does not run your project's `init_hook`, so any environment variables it exports won't be present in the reopened window. Enable `devbox.runInitHookOnReopen` in extension settings to run the `init_hook` and include the variables it sets. Requires a devbox CLI version that supports `devbox integrate vscode --run-init-hook`.

### Debug Mode

Enabling debug mode in extension settings will create a sequence of logs in the file: `.devbox/extension.log`. This feature only tracks the logs for `"Devbox: Reopen in Devbox Shell environment"`.
Expand Down
7 changes: 6 additions & 1 deletion vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "devbox",
"displayName": "devbox by Jetify",
"description": "devbox integration for VSCode",
"version": "0.1.8",
"version": "0.1.9",
"icon": "assets/icon.png",
"repository": {
"type": "git",
Expand Down Expand Up @@ -130,6 +130,11 @@
"type": "boolean",
"default": false,
"description": "Enables debug mode for this extension which creates an extension.log in .devbox/ directory. Currently only works for 'Devbox: Reopen in Devbox shell environment' command."
},
"devbox.runInitHookOnReopen": {
"type": "boolean",
"default": false,
"description": "Run the project's init_hook when using 'Devbox: Reopen in Devbox shell environment' and include any environment variables it sets in the reopened editor. Off by default since init hooks can be slow or have side effects. Requires a devbox CLI version that supports `devbox integrate vscode --run-init-hook`."
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion vscode-extension/src/devbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ export async function devboxReopen() {
const debugModeFlag = workspace.getConfiguration("devbox").get("enableDebugMode");
// name of the currently open editor
const ideName = appNameBinaryMap[env.appName.toLocaleLowerCase()] || 'code';
let child = spawn(devbox, ['integrate', 'vscode', '--debugmode='+debugModeFlag, '--ide='+ideName], {
const args = ['integrate', 'vscode', '--debugmode='+debugModeFlag, '--ide='+ideName];
// Only pass --run-init-hook when enabled so older CLIs that don't
// know the flag keep working with the default settings.
if (workspace.getConfiguration("devbox").get("runInitHookOnReopen")) {
args.push('--run-init-hook');
}
let child = spawn(devbox, args, {
cwd: workingDir.path,
stdio: [0, 1, 2, 'ipc']
});
Expand Down
Loading