-
Notifications
You must be signed in to change notification settings - Fork 2.3k
more subshell checks #8400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
more subshell checks #8400
Conversation
…pression Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some issues that need attention. See inline comments for P1–P2 with concrete next steps.
return `__QUOTE_${quotes.length - 1}__` | ||
}) | ||
|
||
// Handle fish-style command substitutions and POSIX subshell grouping: ( ... ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] In the bare '(' handler for grouping/fish substitutions, arithmetic evaluation '(( ... ))' (without a preceding '$') can be misclassified as a subshell, surfacing faux sub-commands (e.g., 'count++'). Add a guard to keep ((...)) intact rather than extracting it as a subshell.
// Examples: *(+whoami), *(.+{'whoami'}), *(+"whoami") | ||
// Treat + followed by a non-digit token inside a qualifier list as executable (exclude numeric-only like (+1)) | ||
// Anchor to a preceding glob meta to reduce false positives. | ||
const zshGlobQualifierPlusShorthand = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] The zsh glob +shorthand detector may overmatch numeric-only tokens when wrapped (e.g., '(+{1})', '(+"1")'). Consider refining to ignore pure-digit tokens in those branches and add negative tests to pin behavior.
I may have let gpt-5 get too far off the leash with this one.