Skip to content

properly set argv0 when spawning a process#3182

Open
Midnight145 wants to merge 1 commit intowavetermdev:mainfrom
Midnight145:argv0_fix
Open

properly set argv0 when spawning a process#3182
Midnight145 wants to merge 1 commit intowavetermdev:mainfrom
Midnight145:argv0_fix

Conversation

@Midnight145
Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: af992b80-7623-452e-aa25-778196875ffa

📥 Commits

Reviewing files that changed from the base of the PR and between 388b4c9 and ca863cb.

📒 Files selected for processing (1)
  • pkg/shellexec/shellexec.go

Walkthrough

A helper function setCmdArgv0FromPath was added to standardize argv[0] handling across command execution paths. The function derives the executable's base name from cmd.Path (or cmd.Args[0] when Path is empty) and rewrites cmd.Args[0] to use only the base filename. This helper is invoked after constructing exec.Command in multiple process-start code paths: WSL session startup scenarios, local shell startup modes, and RunSimpleCmdInPty. The path/filepath import was added to support base name extraction.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether a description exists that relates to the changeset. Add a pull request description explaining the purpose of the argv0 changes, the problem being solved, and the affected process-start paths.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'properly set argv0 when spawning a process' accurately and concisely describes the main change: implementing proper argv0 setting across multiple process-start paths.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

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