fix(shell-local): avoid ETXTBSY for inline scripts#341
Open
tanmay-hc wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Updates shell-local’s default Unix execution flow for generated inline scripts to avoid ETXTBSY by invoking the configured inline_shebang interpreter to read the temp script rather than executing the temp script directly.
Changes:
- Adjusts
Validateto choose a different defaultexecute_commandon Unix whenInline/Commandis used, invokinginline_shebangwith the script path passed as$0. - Adds unit tests validating the default
execute_commandselection across config modes (inline/command/script/custom). - Adds an integration-style communicator test that runs an inline script while the script file is still open for writing.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| shell-local/config.go | Changes default Unix execute_command for inline/command to run via inline_shebang interpreter to avoid ETXTBSY. |
| shell-local/config_test.go | Adds table-driven coverage for Validate default execute_command behavior. |
| shell-local/communicator_test.go | Adds regression test ensuring inline execution works when the script file remains open for writing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+131
to
+135
| config.ExecuteCommand = []string{ | ||
| "/bin/sh", | ||
| "-c", | ||
| "{{.Vars}} {{.Script}}", | ||
| } |
anurag5sh
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update the default Unix execution path for generated
shell-localinline scripts to invoke the configuredinline_shebanginterpreter instead of executing the temporary script directly.Linux can reject direct execution with
ETXTBSY(Text file busy) when the script is briefly held open for writing by the filesystem or another process. Invoking the interpreter causes it to read the script instead, avoiding that executable-file restriction.Compatibility
execute_commandvalues.inline_shebangand its arguments.scriptandscripts.