Skip to content

/source --special flag, allowing special /commands from an allowlist - #2151

Merged
rolandwalker merged 1 commit into
mainfrom
RW/source-special-flag
Aug 22, 2026
Merged

/source --special flag, allowing special /commands from an allowlist#2151
rolandwalker merged 1 commit into
mainfrom
RW/source-special-flag

Conversation

@rolandwalker

Copy link
Copy Markdown
Contributor

Description

In release v2.12.0, /source scripts were disallowed from running special commands, as part of a fix to the bug in which /source read the entire script into memory.

This seemed like a good call, because some special commands such as /edit might lock up outside of the REPL, and other special commands such as /source itself raise the question of recursion.

However, after a bug report, this change restores the ability to run special commands in side a /source'd script, but only those special commands deemed to be safe in that context, and not by default: the --special flag must be given to /source.

/favorite queries are also not allowed to recurse into special commands.

Fixes #2148, though we still need a followup for the specific issue of exiting without a warning when /source is combined with --execute.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this Aug 22, 2026
from an allowlist.

In release v2.12.0, /source scripts were disallowed from running special
commands, as part of a fix to the bug in which /source read the entire
script into memory.

This seemed like a good call, because some special commands such as
/edit might lock up outside of the REPL, and other special commands
such as /source itself raise the question of recursion.

However, after a bug report, this change restores the ability to run
special commands in side a /source'd script, but only those special
commands deemed to be safe in that context, and not by default: the
--special flag must be given to /source.

/favorite queries are also not allowed to recurse into special commands.
@rolandwalker
rolandwalker force-pushed the RW/source-special-flag branch from b63755f to 2359726 Compare August 22, 2026 12:39
@rolandwalker
rolandwalker merged commit 585e75f into main Aug 22, 2026
11 checks passed
@rolandwalker
rolandwalker deleted the RW/source-special-flag branch August 22, 2026 12:44
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.

Special commands inside source inside --execute are not supported, but the error is not handled correctly.

1 participant