Skip to content
Closed
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
18 changes: 10 additions & 8 deletions book/src/workspace-trust.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Workspace trust

Helix has a number of potentially dangerous features, namely LSP and ability to use local to workspace configurations. Those features can lead to unexpected code execution. To protect against code execution in dangerous contexts, Helix has a workspace trust protection, which will prevent these potentially dangerous features from running automatically.
Helix has a concept of workspace trust. Workspace that is not deemed to be trusted cannot:

Helix will not trust any workspace by default.
- load `.helix/languages.toml` and `.helix/config.toml` files found in the workspace;
- start a language server.

By default, it will prompt about trust when you open new file in a workspace where you didn't make a decision about trust yet.
Helix will not trust any workspace by default.

If you decide not to trust a workspace and don't want to be prompted about trust every time you start a new session in it, you can exclude the workspace by choosing `Never` option in trust selection window.
When you open a file in an untrusted workspace, you will be prompted about trust. You can make a choice with arrow keys, `<Tab>`, `<C-n>` and `<C-p>`, confirming selection with `<Enter>`. Typing anything else will close the menu selecting 'Not now' option.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably more words than we really need, but what I am trying to say here is: you can make the menu go away by pressing pretty much any button except those that do something in the menu.

I think that's really important to understand, so that the thing doesn't get in the way. On the second thought, it should get pretty apparent when you actually use the thing yourself, so it might not need an explanation.


You can always make current workspace trusted by running `:workspace-trust` command, and untrust it with `:workspace-untrust`.
You can always make active workspace trusted by running `:workspace-trust` command, or you can remove trust with `:workspace-untrust`.

Lists of trusted and excluded workspaces, delimited by newline characters, are stored in `~/.local/share/helix/trusted_workspaces` and `~/.local/share/helix/excluded_workspaces` correspondingly.
<!-- TODO: Windows paths -->
Lists of trusted and excluded workspaces, delimited by newline characters, are stored in:
- Linux and macOS: `~/.local/share/helix/trusted_workspaces` and `~/.local/share/helix/excluded_workspaces`
- Windows: `%AppData%/Roaming/helix/trusted_workspaces` and `%AppData%/Roaming/helix/excluded_workspaces`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows path is taken from etcetera's crate code. If I'm holding that code right, this is where it should be stored, but I hope someone with Windows box comes around and tells for sure.


# Configuration

You can return to the old behaviour of loading every local `.helix/config.toml` and `.helix/languages.toml` and starting LSP's without an explicit permission by setting following option:
You can return to the old behavior of implicitly trusting every workspace by setting configuration option:

```toml
[editor]
Expand Down