Skip to content

fix & refactor: workspace-trust#15582

Closed
Rudxain wants to merge 3 commits into
helix-editor:masterfrom
Rudxain:workspace-trust
Closed

fix & refactor: workspace-trust#15582
Rudxain wants to merge 3 commits into
helix-editor:masterfrom
Rudxain:workspace-trust

Conversation

@Rudxain

@Rudxain Rudxain commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

@Rudxain Rudxain force-pushed the workspace-trust branch 2 times, most recently from 3caafd7 to 54421ff Compare April 5, 2026 03:35
@Rudxain

Rudxain commented Apr 5, 2026

Copy link
Copy Markdown
Contributor Author

Elaborating on this, I'm concerned that startup performance would degrade as entries are added to the data-dir files; even when using BufReader, the startup latency could be arbitrarily slow. TBF, that is already the case for config.toml and languages.toml, but the problem is exacerbated by entries only being added to either data-file, so manual intervention is needed to "garbage-collect" non-existent paths.

A solution would be to make ws-trust async, but then the Select dialog would show up at an arbitrary moment after startup. For better UX, a "notification" could be better

@Rudxain Rudxain force-pushed the workspace-trust branch 3 times, most recently from 4854ebd to 41929e6 Compare April 5, 2026 16:53
@Rudxain Rudxain force-pushed the workspace-trust branch 4 times, most recently from 7f8e691 to c0c618a Compare April 6, 2026 09:52
@Rudxain Rudxain changed the title improve workspace-trust fix & refactor: workspace-trust Apr 7, 2026
@Rudxain Rudxain force-pushed the workspace-trust branch 3 times, most recently from 9cc372b to 5ed46fa Compare April 7, 2026 05:51
@Rudxain Rudxain marked this pull request as ready for review April 7, 2026 06:05
@Rudxain Rudxain force-pushed the workspace-trust branch 4 times, most recently from b1c913e to cb7f806 Compare April 7, 2026 06:20
xe-nul pushed a commit to xe-nul/helix that referenced this pull request May 13, 2026
refactor(workspace_trust): minor changes

fix(workspace_trust): secure permissions on Unix

fix(workspace_trust): reject paths with \n
xe-nul added a commit to xe-nul/helix that referenced this pull request May 13, 2026
xe-nul added a commit to xe-nul/helix that referenced this pull request May 13, 2026
xe-nul added a commit to xe-nul/helix that referenced this pull request May 13, 2026
xe-nul added a commit to xe-nul/helix that referenced this pull request May 13, 2026
xe-nul added a commit to xe-nul/helix that referenced this pull request May 13, 2026
xe-nul added a commit to xe-nul/helix that referenced this pull request May 13, 2026
xe-nul added a commit to xe-nul/helix that referenced this pull request May 13, 2026
xe-nul added a commit to xe-nul/helix that referenced this pull request May 14, 2026
xe-nul added a commit to xe-nul/helix that referenced this pull request May 18, 2026
xe-nul added a commit to xe-nul/helix that referenced this pull request May 18, 2026
Change `PathBuf` to `Path`, as per suggestion from archseer
iniw pushed a commit to iniw/helix that referenced this pull request May 19, 2026
PR helix-editor#15582
refactor(workspace_trust): minor changes

fix(workspace_trust): secure permissions on Unix

fix(workspace_trust): reject paths with \n

PR helix-editor#15590

refactor(helix-loader): split out duplicated code

In the workspace trust code, the code to search a path in a file was
copy-pasted three times. This splits it out into a helper function.

refactor(helix-loader): use BufReader to read trust files

When the workspace trust files become large, using a BufReader can
increase performance, as it won't block until the whole file is loaded
into RAM.

refactor(helix-loader): cache workspace trust, unify with PROMPTED_WORKSPACES

Since `quick_query_workspace()` and
`quick_query_workspace_with_explicit_untrust()` are currently called
seven times on startup, it makes sense to cache the result. With this
in place, the previous cache for prompted workspaces could be merged
into this.

Docs (helix-editor#15636)

Improve readability and grammar of workspace trust docs and popup

Rewrite of helix-editor#15592

Merge of helix-editor#15582 and rewritten helix-editor#15592

Change `PathBuf` to `Path`, as per suggestion from archseer

Use workspace trust in git subsystem

Replace default gitoxide's model of trust (directory
ownership) with our own one.

Closes helix-editor#15594

Merge of everything with helix-editor#15644

Expand docs; merge wirh everything else

Hardening of workspace-trust-related file modes and permissions

Do not query for trust if there are no langugage servers to start

Refactor: save state into `Editor`; get rid of statics

Add an option to disable trust selector pop-up

Add `:workspace-exclude` typable command

Update docs

Add 'Only once' selector option and `:workspace-trust-once` typable

Allow setting trust via globbed paths in config

Co-authored-by: Rudxain <76864299+Rudxain@users.noreply.github.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: David <12832280+David-Else@users.noreply.github.com>
iniw pushed a commit to iniw/helix that referenced this pull request May 19, 2026
PR helix-editor#15582
refactor(workspace_trust): minor changes

fix(workspace_trust): secure permissions on Unix

fix(workspace_trust): reject paths with \n

PR helix-editor#15590

refactor(helix-loader): split out duplicated code

In the workspace trust code, the code to search a path in a file was
copy-pasted three times. This splits it out into a helper function.

refactor(helix-loader): use BufReader to read trust files

When the workspace trust files become large, using a BufReader can
increase performance, as it won't block until the whole file is loaded
into RAM.

refactor(helix-loader): cache workspace trust, unify with PROMPTED_WORKSPACES

Since `quick_query_workspace()` and
`quick_query_workspace_with_explicit_untrust()` are currently called
seven times on startup, it makes sense to cache the result. With this
in place, the previous cache for prompted workspaces could be merged
into this.

Docs (helix-editor#15636)

Improve readability and grammar of workspace trust docs and popup

Rewrite of helix-editor#15592

Merge of helix-editor#15582 and rewritten helix-editor#15592

Change `PathBuf` to `Path`, as per suggestion from archseer

Use workspace trust in git subsystem

Replace default gitoxide's model of trust (directory
ownership) with our own one.

Closes helix-editor#15594

Merge of everything with helix-editor#15644

Expand docs; merge wirh everything else

Hardening of workspace-trust-related file modes and permissions

Do not query for trust if there are no langugage servers to start

Refactor: save state into `Editor`; get rid of statics

Add an option to disable trust selector pop-up

Add `:workspace-exclude` typable command

Update docs

Add 'Only once' selector option and `:workspace-trust-once` typable

Allow setting trust via globbed paths in config

Co-authored-by: Rudxain <76864299+Rudxain@users.noreply.github.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: David <12832280+David-Else@users.noreply.github.com>
iniw pushed a commit to iniw/helix that referenced this pull request May 22, 2026
PR helix-editor#15582
refactor(workspace_trust): minor changes

fix(workspace_trust): secure permissions on Unix

fix(workspace_trust): reject paths with \n

PR helix-editor#15590

refactor(helix-loader): split out duplicated code

In the workspace trust code, the code to search a path in a file was
copy-pasted three times. This splits it out into a helper function.

refactor(helix-loader): use BufReader to read trust files

When the workspace trust files become large, using a BufReader can
increase performance, as it won't block until the whole file is loaded
into RAM.

refactor(helix-loader): cache workspace trust, unify with PROMPTED_WORKSPACES

Since `quick_query_workspace()` and
`quick_query_workspace_with_explicit_untrust()` are currently called
seven times on startup, it makes sense to cache the result. With this
in place, the previous cache for prompted workspaces could be merged
into this.

Docs (helix-editor#15636)

Improve readability and grammar of workspace trust docs and popup

Rewrite of helix-editor#15592

Merge of helix-editor#15582 and rewritten helix-editor#15592

Change `PathBuf` to `Path`, as per suggestion from archseer

Use workspace trust in git subsystem

Replace default gitoxide's model of trust (directory
ownership) with our own one.

Closes helix-editor#15594

Merge of everything with helix-editor#15644

Expand docs; merge wirh everything else

Hardening of workspace-trust-related file modes and permissions

Do not query for trust if there are no langugage servers to start

Refactor: save state into `Editor`; get rid of statics

Add an option to disable trust selector pop-up

Add `:workspace-exclude` typable command

Update docs

Add 'Only once' selector option and `:workspace-trust-once` typable

Allow setting trust via globbed paths in config

Co-authored-by: Rudxain <76864299+Rudxain@users.noreply.github.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: David <12832280+David-Else@users.noreply.github.com>
iniw pushed a commit to iniw/helix that referenced this pull request May 22, 2026
PR helix-editor#15582
refactor(workspace_trust): minor changes

fix(workspace_trust): secure permissions on Unix

fix(workspace_trust): reject paths with \n

PR helix-editor#15590

refactor(helix-loader): split out duplicated code

In the workspace trust code, the code to search a path in a file was
copy-pasted three times. This splits it out into a helper function.

refactor(helix-loader): use BufReader to read trust files

When the workspace trust files become large, using a BufReader can
increase performance, as it won't block until the whole file is loaded
into RAM.

refactor(helix-loader): cache workspace trust, unify with PROMPTED_WORKSPACES

Since `quick_query_workspace()` and
`quick_query_workspace_with_explicit_untrust()` are currently called
seven times on startup, it makes sense to cache the result. With this
in place, the previous cache for prompted workspaces could be merged
into this.

Docs (helix-editor#15636)

Improve readability and grammar of workspace trust docs and popup

Rewrite of helix-editor#15592

Merge of helix-editor#15582 and rewritten helix-editor#15592

Change `PathBuf` to `Path`, as per suggestion from archseer

Use workspace trust in git subsystem

Replace default gitoxide's model of trust (directory
ownership) with our own one.

Closes helix-editor#15594

Merge of everything with helix-editor#15644

Expand docs; merge wirh everything else

Hardening of workspace-trust-related file modes and permissions

Do not query for trust if there are no langugage servers to start

Refactor: save state into `Editor`; get rid of statics

Add an option to disable trust selector pop-up

Add `:workspace-exclude` typable command

Update docs

Add 'Only once' selector option and `:workspace-trust-once` typable

Allow setting trust via globbed paths in config

Co-authored-by: Rudxain <76864299+Rudxain@users.noreply.github.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: David <12832280+David-Else@users.noreply.github.com>
iniw pushed a commit to iniw/helix that referenced this pull request May 26, 2026
PR helix-editor#15582
refactor(workspace_trust): minor changes

fix(workspace_trust): secure permissions on Unix

fix(workspace_trust): reject paths with \n

PR helix-editor#15590

refactor(helix-loader): split out duplicated code

In the workspace trust code, the code to search a path in a file was
copy-pasted three times. This splits it out into a helper function.

refactor(helix-loader): use BufReader to read trust files

When the workspace trust files become large, using a BufReader can
increase performance, as it won't block until the whole file is loaded
into RAM.

refactor(helix-loader): cache workspace trust, unify with PROMPTED_WORKSPACES

Since `quick_query_workspace()` and
`quick_query_workspace_with_explicit_untrust()` are currently called
seven times on startup, it makes sense to cache the result. With this
in place, the previous cache for prompted workspaces could be merged
into this.

Docs (helix-editor#15636)

Improve readability and grammar of workspace trust docs and popup

Rewrite of helix-editor#15592

Merge of helix-editor#15582 and rewritten helix-editor#15592

Change `PathBuf` to `Path`, as per suggestion from archseer

Use workspace trust in git subsystem

Replace default gitoxide's model of trust (directory
ownership) with our own one.

Closes helix-editor#15594

Merge of everything with helix-editor#15644

Expand docs; merge wirh everything else

Hardening of workspace-trust-related file modes and permissions

Do not query for trust if there are no langugage servers to start

Refactor: save state into `Editor`; get rid of statics

Add an option to disable trust selector pop-up

Add `:workspace-exclude` typable command

Update docs

Add 'Only once' selector option and `:workspace-trust-once` typable

Allow setting trust via globbed paths in config

Co-authored-by: Rudxain <76864299+Rudxain@users.noreply.github.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: David <12832280+David-Else@users.noreply.github.com>
xe-nul pushed a commit to xe-nul/helix that referenced this pull request May 26, 2026
refactor(workspace_trust): minor changes

fix(workspace_trust): secure permissions on Unix

fix(workspace_trust): reject paths with \n
xe-nul added a commit to xe-nul/helix that referenced this pull request May 26, 2026
Change `PathBuf` to `Path`, as per suggestion from archseer
xe-nul pushed a commit to xe-nul/helix that referenced this pull request May 27, 2026
refactor(workspace_trust): minor changes

fix(workspace_trust): secure permissions on Unix

fix(workspace_trust): reject paths with \n
xe-nul added a commit to xe-nul/helix that referenced this pull request May 27, 2026
Change `PathBuf` to `Path`, as per suggestion from archseer
iniw pushed a commit to iniw/helix that referenced this pull request May 27, 2026
PR helix-editor#15582
refactor(workspace_trust): minor changes

fix(workspace_trust): secure permissions on Unix

fix(workspace_trust): reject paths with \n

PR helix-editor#15590

refactor(helix-loader): split out duplicated code

In the workspace trust code, the code to search a path in a file was
copy-pasted three times. This splits it out into a helper function.

refactor(helix-loader): use BufReader to read trust files

When the workspace trust files become large, using a BufReader can
increase performance, as it won't block until the whole file is loaded
into RAM.

refactor(helix-loader): cache workspace trust, unify with PROMPTED_WORKSPACES

Since `quick_query_workspace()` and
`quick_query_workspace_with_explicit_untrust()` are currently called
seven times on startup, it makes sense to cache the result. With this
in place, the previous cache for prompted workspaces could be merged
into this.

Docs (helix-editor#15636)

Improve readability and grammar of workspace trust docs and popup

Rewrite of helix-editor#15592

Merge of helix-editor#15582 and rewritten helix-editor#15592

Change `PathBuf` to `Path`, as per suggestion from archseer

Use workspace trust in git subsystem

Replace default gitoxide's model of trust (directory
ownership) with our own one.

Closes helix-editor#15594

Merge of everything with helix-editor#15644

Expand docs; merge wirh everything else

Hardening of workspace-trust-related file modes and permissions

Do not query for trust if there are no langugage servers to start

Refactor: save state into `Editor`; get rid of statics

Add an option to disable trust selector pop-up

Add `:workspace-exclude` typable command

Update docs

Add 'Only once' selector option and `:workspace-trust-once` typable

Allow setting trust via globbed paths in config

Co-authored-by: Rudxain <76864299+Rudxain@users.noreply.github.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: David <12832280+David-Else@users.noreply.github.com>
iniw pushed a commit to iniw/helix that referenced this pull request Jun 1, 2026
PR helix-editor#15582
refactor(workspace_trust): minor changes

fix(workspace_trust): secure permissions on Unix

fix(workspace_trust): reject paths with \n

PR helix-editor#15590

refactor(helix-loader): split out duplicated code

In the workspace trust code, the code to search a path in a file was
copy-pasted three times. This splits it out into a helper function.

refactor(helix-loader): use BufReader to read trust files

When the workspace trust files become large, using a BufReader can
increase performance, as it won't block until the whole file is loaded
into RAM.

refactor(helix-loader): cache workspace trust, unify with PROMPTED_WORKSPACES

Since `quick_query_workspace()` and
`quick_query_workspace_with_explicit_untrust()` are currently called
seven times on startup, it makes sense to cache the result. With this
in place, the previous cache for prompted workspaces could be merged
into this.

Docs (helix-editor#15636)

Improve readability and grammar of workspace trust docs and popup

Rewrite of helix-editor#15592

Merge of helix-editor#15582 and rewritten helix-editor#15592

Change `PathBuf` to `Path`, as per suggestion from archseer

Use workspace trust in git subsystem

Replace default gitoxide's model of trust (directory
ownership) with our own one.

Closes helix-editor#15594

Merge of everything with helix-editor#15644

Expand docs; merge wirh everything else

Hardening of workspace-trust-related file modes and permissions

Do not query for trust if there are no langugage servers to start

Refactor: save state into `Editor`; get rid of statics

Add an option to disable trust selector pop-up

Add `:workspace-exclude` typable command

Update docs

Add 'Only once' selector option and `:workspace-trust-once` typable

Allow setting trust via globbed paths in config

Co-authored-by: Rudxain <76864299+Rudxain@users.noreply.github.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: David <12832280+David-Else@users.noreply.github.com>
iniw pushed a commit to iniw/helix that referenced this pull request Jun 1, 2026
PR helix-editor#15582
refactor(workspace_trust): minor changes

fix(workspace_trust): secure permissions on Unix

fix(workspace_trust): reject paths with \n

PR helix-editor#15590

refactor(helix-loader): split out duplicated code

In the workspace trust code, the code to search a path in a file was
copy-pasted three times. This splits it out into a helper function.

refactor(helix-loader): use BufReader to read trust files

When the workspace trust files become large, using a BufReader can
increase performance, as it won't block until the whole file is loaded
into RAM.

refactor(helix-loader): cache workspace trust, unify with PROMPTED_WORKSPACES

Since `quick_query_workspace()` and
`quick_query_workspace_with_explicit_untrust()` are currently called
seven times on startup, it makes sense to cache the result. With this
in place, the previous cache for prompted workspaces could be merged
into this.

Docs (helix-editor#15636)

Improve readability and grammar of workspace trust docs and popup

Rewrite of helix-editor#15592

Merge of helix-editor#15582 and rewritten helix-editor#15592

Change `PathBuf` to `Path`, as per suggestion from archseer

Use workspace trust in git subsystem

Replace default gitoxide's model of trust (directory
ownership) with our own one.

Closes helix-editor#15594

Merge of everything with helix-editor#15644

Expand docs; merge wirh everything else

Hardening of workspace-trust-related file modes and permissions

Do not query for trust if there are no langugage servers to start

Refactor: save state into `Editor`; get rid of statics

Add an option to disable trust selector pop-up

Add `:workspace-exclude` typable command

Update docs

Add 'Only once' selector option and `:workspace-trust-once` typable

Allow setting trust via globbed paths in config

Co-authored-by: Rudxain <76864299+Rudxain@users.noreply.github.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: David <12832280+David-Else@users.noreply.github.com>
xe-nul pushed a commit to xe-nul/helix that referenced this pull request Jun 7, 2026
refactor(workspace_trust): minor changes

fix(workspace_trust): secure permissions on Unix

fix(workspace_trust): reject paths with \n
xe-nul added a commit to xe-nul/helix that referenced this pull request Jun 7, 2026
Change `PathBuf` to `Path`, as per suggestion from archseer
@archseer

Copy link
Copy Markdown
Member

Replaced by #15857

@archseer archseer closed this Jun 20, 2026
@Rudxain Rudxain deleted the workspace-trust branch June 21, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants