xonsh/news
Andy Kipp c3a12b2a9c
feat: add --no-env flag to avoid inheriting parent-shell env (#5370)
### Motivation

Basically we use `xonsh --no-rc` to have pure xonsh. 
I noticed many times when parent environment can affect `xonsh --no-rc` e.g. `$XONSH_HISTORY_FILE`.
Current workaround is `env -i @$(which xonsh) --no-rc` but I think we need to have pure xonsh way.

Closes #4921

### Before

```xsh
xonsh --no-rc
$QWE = 1
xonsh --no-rc
$QWE
# 1
```

### After
```xsh
xonsh --no-rc
$QWE = 1
xonsh --no-rc --no-env
$QWE
# Unknown environment variable: $QWE

$XONSH_ENV_INHERITED  # Marker to have a way to catch this situation.
# False
```

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2024-04-29 12:29:22 -04:00
..
appimage_py311.rst Downgrade AppImage to 3.11 (#5364) 2024-04-25 11:46:36 +02:00
jobs_catch_no_process.rst jobs: catching ChildProcessError (#5365) 2024-04-26 10:34:31 +02:00
jobs_repr.rst jobs: default representation changed to dict (#5363) 2024-04-26 10:26:24 +02:00
no_env.rst feat: add --no-env flag to avoid inheriting parent-shell env (#5370) 2024-04-29 12:29:22 -04:00
popen_name.rst Add thread details to the exception (#5360) 2024-04-24 11:15:40 +02:00
shell_type.rst Shortcut for shell-type (#5367) 2024-04-25 20:10:18 +02:00
TEMPLATE.rst single instance of string.Formatter 2018-10-20 12:22:59 -06:00
trace_subproc.rst wip 2024-04-26 13:37:19 +05:30
zulip.rst Xonsh Zulip Community started (#5372) 2024-04-29 10:01:02 -04:00