Skip to content

Preserve background job markers in batch commands - #3280

Open
hutiefang76 wants to merge 1 commit into
alibaba:masterfrom
hutiefang76:frank/thirty-arthas-batch-20261020
Open

hutiefang76 wants to merge 1 commit into
alibaba:masterfrom
hutiefang76:frank/thirty-arthas-batch-20261020

Conversation

@hutiefang76

Copy link
Copy Markdown

Fixes #3223.

Batch mode currently appends | plaintext after every command. This moves a trailing & away from the position where the server recognizes a background job. For the documented watch ... > & 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 | plaintext before 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:

  • JDK 8: ./mvnw -B -pl client -am clean verify passes all 21 tests, with no failures, errors or skips. The same tests on the unchanged client reproduce 10 assertion failures, with 11 controls passing.
  • Compared 392 command forms with the actual server tokenizer and termd version, including quotes, escapes, Unicode, redirection and pipe-adjacent background markers.
  • Attached official Arthas 4.3.5 to a dedicated local JVM and ran a two-line batch file containing watch ... -n 2 > & and jobs. 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.
  • Built the VuePress site with the project's Node 16.13.2/Yarn 1.22.15 toolchain and checked both rendered pages and their async-job links. git diff --check passes.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T18:41:59.532281Z e8c7ed5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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

No deployments
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