Skip to content

Wrap metals:default-shell command arguments in quotes - #8716

Open
jchyb wants to merge 1 commit into
scalameta:main-v2from
jchyb:shell-fix
Open

Wrap metals:default-shell command arguments in quotes#8716
jchyb wants to merge 1 commit into
scalameta:main-v2from
jchyb:shell-fix

Conversation

@jchyb

@jchyb jchyb commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The issue appeared when importing a bazel project for MBT while using the metals:default-shell setting.
Without this, for any command that includes parentheses, these may be interpreted as e.g. glob qualifier syntax.

The issue was found and tested using zsh (and when that is set as metals:default-shell flag), but solution should work with other shells.

Before:

  2026.07.22 15:26:53 INFO  Running command: /bin/zsh -i -l -c bazel query --output=label --keep_going kind(scala_library, @//...:all) union kind(java_library, @//...:all) union kind(scala_binary, @//...:all) union kind(java_binary,     
  @//...:all) union kind(scala_test, @//...:all) union kind(java_test, @//...:all) union kind(scala_import, @//...:all) union kind(java_import, @//...:all)                                                                                                                 
  2026.07.22 15:26:54 WARN  zsh:1: number expected 
[the query itself would fail]             

After:

2026.07.22 16:05:24 INFO  Running command: /bin/zsh -i -l -c 'bazel' 'query' '--output=label' '--keep_going' 'kind(scala_library, @//...:all) union kind(java_library, @//...:all) union kind(scala_binary, @//...:all) union kind(java_binary, @//...:all) union kind(scala_test, @//...:all) union kind(java_test, @//...:all) union kind(scala_import, @//...:all) union kind(java_import, @//...:all)'[0m
[no failure]

Otherwise for any command that includes parentheses, these may be
interpreted as e.g. glob qualifier syntax

The issue was found and tested using zsh (and when that is set as
metals:default-shell flag), but solution should work with other shells.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d8e442eb-cf28-4364-8d1f-52179d7ea0e5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant