Repository: xonsh/xonsh

Issue:
Subprocess output not captured
Yesterday, I read up on history in xonsh and in particular about capturing output of the commands.

I saw in the docs, it indicated that `XONSH_STORE_STDOUT` needs to be configured, but while I was testing in my environment, I found that not to be the case. XONSH_STORE_STDOUT was not set, yet output was being captured.

Incidentally, I also upgraded xonsh around this time. I suspect I was running 0.9.x, but I don't recall exactly. Now I'm running 0.11.0.

And now, when I try to extract the output from a recent command, it doesn't work:

```
~ $ $XONSH_STORE_STDOUT
True
~ $ echo foo
foo
~ $ __xonsh__.history[-1].out is None
True
```

Following the docs, I added the following to a file that gets sourced during .xonshrc (verified in the output above).

What else should I try to restore history stdout support? I can bisect releases if needed, but I'm guessing the maintainers might know what's going on.

I did search the issues and also changelog, but didn't find anything relevant.

## xonfig

<details>

```
~ $ xonfig
+------------------+----------------------------------------+
| xonsh            | 0.11.0                                 |
| Git SHA          | 337cf25a                               |
| Commit Date      | Nov 17 15:37:41 2021                   |
| Python           | 3.9.7                                  |
| PLY              | 3.11                                   |
| have readline    | True                                   |
| prompt toolkit   | 3.0.18                                 |
| shell type       | prompt_toolkit                         |
| history backend  | json                                   |
| pygments         | None                                   |
| on posix         | True                                   |
| on linux         | True                                   |
| distro           | unknown                                |
| on wsl           | False                                  |
| on darwin        | False                                  |
| on windows       | False                                  |
| on cygwin        | False                                  |
| on msys2         | False                                  |
| is superuser     | False                                  |
| default encoding | utf-8                                  |
| xonsh encoding   | utf-8                                  |
| encoding errors  | surrogateescape                        |
| on jupyter       | False                                  |
| jupyter kernel   | None                                   |
| xontrib 1        | vox                                    |
| xontrib 2        | voxapi                                 |
+------------------+----------------------------------------+
```

</details>

## Expected Behavior

Output should have been captured.

## Current Behavior

No output is captured.

## For community
⬇️  **Please click the 👍 reaction instead of leaving a `+1` or 👍  comment**



Discussion:
This is related to #4283 and please read about [XONSH_CAPTURE_ALWAYS](https://xon.sh/envvars.html#xonsh-capture-always).

```bash
XONSH_CAPTURE_ALWAYS=True xonsh --no-rc
echo 123
__xonsh__.history[0]
# HistoryEntry(cmd='echo 123\n', cwd='/tmp', out='123\n', rtn=0, ts=[1638312632.1047597, 1638312632.1226358])
#                                            ^^^^^^^^^^^
```
Where we should fix the documentation?
I can submit a PR.

Resolving patch:
diff --git a/xonsh/environ.py b/xonsh/environ.py
--- a/xonsh/environ.py
+++ b/xonsh/environ.py
@@ -876,7 +876,8 @@ class GeneralSetting(Xettings):
     XONSH_CAPTURE_ALWAYS = Var.with_default(
         False,
         "Try to capture output of commands run without explicit capturing.\n"
-        "If True, xonsh will capture the output of commands run directly or in ``![]``.\n"
+        "If True, xonsh will capture the output of commands run directly or in ``![]``"
+        "to the session history.\n"
         "Setting to True has the following disadvantages:\n"
         "* Some interactive commands won't work properly (like when ``git`` invokes an interactive editor).\n"
         "  For more information see discussion at https://github.com/xonsh/xonsh/issues/3672.\n"
@@ -1492,8 +1493,8 @@ class PromptHistorySetting(Xettings):
     )
     XONSH_STORE_STDOUT = Var.with_default(
         False,
-        "Whether or not to store the ``stdout`` and ``stderr`` streams in the "
-        "history files.",
+        "Store the ``stdout`` and ``stderr`` streams to the history. "
+        "Requires that XONSH_CAPTURE_ALWAYS is True.",
     )
     XONSH_HISTORY_SAVE_CWD = Var.with_default(
         True,


Test patch: