Repository navigation
Preserve background job markers in batch commands - #3280
Open
hutiefang76 wants to merge 1 commit into
Open
hutiefang76 wants to merge 1 commit into
hutiefang76 wants to merge 1 commit into
Conversation
Appending the plaintext pipe after the final ampersand makes the server treat a background command as foreground and can create a file named ampersand. Keep redirected background commands intact and insert plaintext before the background marker otherwise.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
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.
Fixes #3223.
Batch mode currently appends
| plaintextafter every command. This moves a trailing&away from the position where the server recognizes a background job. For the documentedwatch ... > &form, the server instead opens a file literally named&and runs the command in the foreground.Keep redirected background commands unchanged, since redirection already produces plain text. For background commands without redirection, insert
| plaintextbefore the final background marker. Match the server's quoted, escaped and pipe-adjacent token rules so ordinary arguments are preserved. Foreground commands retain their existing behavior; no dependencies or server-side changes are added.The Chinese and English batch docs now include copyable redirection examples, distinguish redirected background output from terminal output, and explain that the background marker must be last.
Validation:
./mvnw -B -pl client -am clean verifypasses all 21 tests, with no failures, errors or skips. The same tests on the unchanged client reproduce 10 assertion failures, with 11 controls passing.watch ... -n 2 > &andjobs. The original client creates the incorrect&file. The fixed client returns while the job is running and the fixture is idle; triggering the method after the client has exited produces plain-text output in the automatic cache file. The test JVM is stopped afterward.git diff --checkpasses.