Skip to content

fix: Increase @$() stability and now it is also working in case of $THREAD_SUBPROCS=False#6112

Merged
anki-code merged 9 commits into
xonsh:mainfrom
anki-code:fix_cap_inject
Mar 5, 2026
Merged

fix: Increase @$() stability and now it is also working in case of $THREAD_SUBPROCS=False#6112
anki-code merged 9 commits into
xonsh:mainfrom
anki-code:fix_cap_inject

Conversation

@anki-code

@anki-code anki-code commented Mar 2, 2026

Copy link
Copy Markdown
Member

Motivation

  1. @$() is using captured_object that is working in parallel thread and sometimes can produce race condition. We need to replace it back to captured_stdout. cc Fix @$() subprocess operator #3512
  2. Because of $() is working in $THREAD_SUBPROCS=False so @$() should work.

Closes #4056
cc #4094

Before

$THREAD_SUBPROCS=False
showcmd $(echo '1\n2 3')  # working
# ['1\n2 3\n']
showcmd @$(echo '1\n2 3')  # not working
# 1    # not captured
# 2 3  # not captured
# <showcmd help>

After

$THREAD_SUBPROCS=False
showcmd $(echo '1\n2 3')  # working
# ['1\n2 3\n']
showcmd @$(echo '1\n2 3')  # working
# ['1', '2', '3']

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

@anki-code anki-code requested a review from jnoortheen March 2, 2026 15:25
@anki-code anki-code changed the title fix: Now @$() is working in case of $THREAD_SUBPROCS=False fix: Now @$() is working in case of $THREAD_SUBPROCS=False like $() Mar 2, 2026
@anki-code anki-code changed the title fix: Now @$() is working in case of $THREAD_SUBPROCS=False like $() fix: Now @$() is working in case of $THREAD_SUBPROCS=False Mar 2, 2026
@anki-code anki-code marked this pull request as draft March 2, 2026 15:33
@anki-code anki-code requested a review from gforsyth March 3, 2026 06:18
@anki-code anki-code changed the title fix: Now @$() is working in case of $THREAD_SUBPROCS=False fix: Increase @$() stability and now it is also working in case of $THREAD_SUBPROCS=False Mar 3, 2026
@anki-code

Copy link
Copy Markdown
Member Author

I'm going to do self-merge to complete test of the fix #6115

@anki-code anki-code merged commit a3ac036 into xonsh:main Mar 5, 2026
19 checks passed
anki-code pushed a commit that referenced this pull request Mar 5, 2026
🤖 I have created a release *beep* *boop*
---


## [0.22.5](0.22.4...0.22.5)
(2026-03-05)


### Features

* Added useful command decorators: `[@lines](https://github.com/lines)`,
`[@JSON](https://github.com/json)`,
`[@jsonl](https://github.com/jsonl)`, `[@yaml](https://github.com/yaml)`
([#6114](#6114))
([0f7124e](0f7124e))


### Bug Fixes

* **completion:** Fix os.path.commonprefix deprecation warning in
python3.15 ([#6102](#6102))
([2b5b2bb](2b5b2bb))
* Increase `@$()` stability and now it is also working in case of
`$THREAD_SUBPROCS=False`
([#6112](#6112))
([a3ac036](a3ac036))
* **predictor:** Fix predict_threadable to properly handle symlinks,
especially on NixOS
([#6115](#6115))
([bc01b04](bc01b04))
* **prompt:** Keep original key_bindings in prompt-toolkit shell to easy
add new key bindings during session
([#6093](#6093))
([e9b0aea](e9b0aea))
* replace 12 bare except clauses with except Exception
([#6110](#6110))
([54b311c](54b311c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: xonsh-credentials-bot[bot] <97968350+xonsh-credentials-bot[bot]@users.noreply.github.com>
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.

@$(cmd) substitution doesn't work properly with $THREAD_SUBPROCS off, but de-sugaring it does

1 participant