Skip to content

fix: use default shell for run - #7471

Closed
aaceimmrttu wants to merge 2 commits into
continuedev:mainfrom
aaceimmrttu:bugfix/use-default-shell-for-run
Closed

aaceimmrttu wants to merge 2 commits into
continuedev:mainfrom
aaceimmrttu:bugfix/use-default-shell-for-run

Conversation

@aaceimmrttu

@aaceimmrttu aaceimmrttu commented Aug 29, 2025 •

Copy link
Copy Markdown

Description

Fixed bug in runTerminalCommand only using /bin/sh shell

  • Changed hardcoded /bin/sh to process.env.SHELL or POWERSHELL.EXE for cli extension

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-general-review or @continue-detailed-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

OLD:
Screenshot 2025-08-27 at 11 31 27 AM

FIX:
Screenshot 2025-08-27 at 11 28 51 AM

Tests

  • added test for checking shell

Summary by cubic

Fixes runTerminalCommand to use the user’s default shell instead of hardcoded /bin/sh, so commands run in the expected environment on macOS/Linux and Windows. Also adds safer cwd handling and better color support.

  • Bug Fixes
    • Use process.env.SHELL on Unix/macOS; use PowerShell on Windows.
    • Run Unix shells as a login shell (-l) so rc files are sourced.
    • Fallback cwd to HOME/USERPROFILE or os.tmpdir() if process.cwd() fails.
    • Enable color output by setting common color env vars.
    • Add test to verify the system default shell is used.

@aaceimmrttu
aaceimmrttu requested a review from a team as a code owner August 29, 2025 00:43
@aaceimmrttu
aaceimmrttu requested review from tingwai and removed request for a team August 29, 2025 00:43
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 29, 2025
@github-actions

github-actions Bot commented Aug 29, 2025 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@aaceimmrttu

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@aaceimmrttu

Copy link
Copy Markdown
Author

recheck

@aaceimmrttu
aaceimmrttu force-pushed the bugfix/use-default-shell-for-run branch from 17ed75c to 95a10ec Compare August 29, 2025 01:39
@aaceimmrttu aaceimmrttu changed the title Bugfix/use default shell for run fix: use default shell for run Aug 29, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 29, 2025
@aaceimmrttu
aaceimmrttu deleted the bugfix/use-default-shell-for-run branch August 29, 2025 02:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant