Skip to content

Fix automationProfile to handle args and env parameters#771

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/fix-automationprofile-args-issue
Draft

Fix automationProfile to handle args and env parameters#771
Copilot wants to merge 4 commits intomainfrom
copilot/fix-automationprofile-args-issue

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

  • Analyze the issue: automationProfile.args and env are ignored in spawnChildProcess
  • Identify the code to fix in /src/util.ts
  • Implement fix to properly handle args and env parameters from automationProfile
  • Add AutomationProfileSetting interface and parseShellSetting helper function
  • Add unit tests for parseShellSetting function
  • Keep "shell type" label (per reviewer feedback)
  • Update test baselines to include "shell args" output
Original prompt

This section details on the original issue you should resolve

<issue_title>automationProfile ignores args Parameter</issue_title>
<issue_description>### Brief Issue Summary

I tried setting up the extension with msys2.

Im using both terminal.integrated.profiles.windows and terminal.integrated.automationProfile.windows with identical values.

When compiling via terminal compilation succeeds, when configuring the extension i get a make.exe: command not found error indicating, that the --login option has been ignored and only the path is used.


from my settings.json:

"terminal.integrated.automationProfile.windows": {
    "path": "C:/msys64/usr/bin/bash.exe",
    "args": [
        "--login",
        "-i",
    ],
    "env": {
        "MSYSTEM": "UCRT64",
        "CHERE_INVOKING": "1",
        "MSYS2_PATH_TYPE": "inherit",
    },
},

Debug Log

dryrun.log and targets.log:

make.exe --dry-run --keep-going --print-directory
/usr/bin/bash: line 1: make.exe: command not found

___

Additional Information

No response</issue_description>

<agent_instructions>Please add tests if possible.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@gcampbell-msft @koneu Thanks for the issue, we have known issues and/or improvements needed when it comes to the automationProfile settings in VS Code. I'll mark this accordingly and add it to our backlog.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 29, 2026 20:09
When the terminal.integrated.automationProfile setting is an object with
path, args, and env properties, only the path was being used. This fix:

1. Adds AutomationProfileSetting interface to properly type the setting
2. Extracts and uses args parameter when spawning child processes
3. Merges env from automationProfile with the spawn environment
4. Adds parseShellSetting helper function for testability
5. Adds unit tests for parseShellSetting function

Fixes the issue where --login and other shell args were ignored when
using msys2 or similar shells that require specific initialization args.

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
Add documentation explaining:
- The -c flag is for POSIX-compatible shells (the expected use case)
- quoteStringIfNeeded handles spaces and ampersands per existing codebase behavior

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix automationProfile to handle args parameter correctly Fix automationProfile to handle args and env parameters Jan 29, 2026
Copilot AI requested a review from snehara99 January 29, 2026 20:19
@snehara99
Copy link
Contributor

@copilot can you keep the "shell type" label instead of changing it to "shell path"? If you strongly believe this should be changed, please explain why. Also existing tests are failing. Please update the tests to account for the new changes.

- Reverted "shell path" back to "shell type" in log message as requested
- Updated test baselines to include new "shell args" output line

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 2, 2026

@copilot can you keep the "shell type" label instead of changing it to "shell path"? If you strongly believe this should be changed, please explain why. Also existing tests are failing. Please update ...

Reverted "shell path" back to "shell type" and updated the test baselines (test_real_make_nonWin_baseline.out and test_real_make_windows_baseline.out) to include the new "shell args: none" line. Commit 106f7d6.

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.

automationProfile ignores args Parameter

2 participants