Skip to content

Commit f8449c2

Browse files
committed
stop excluding TERM env var on Unix
1 parent f633537 commit f8449c2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,8 @@ environment variable. We first document the most relevant and most commonly used
282282
verbose. `hide` hides the warning entirely.
283283
* `-Zmiri-env-exclude=<var>` keeps the `var` environment variable isolated from the host so that it
284284
cannot be accessed by the program. Can be used multiple times to exclude several variables. The
285-
`TERM` environment variable is excluded by default to [speed up the test
286-
harness](https://github.com/rust-lang/miri/issues/1702). This has no effect unless
287-
`-Zmiri-disable-isolation` is also set.
285+
`TERM` environment variable is excluded by default in Windows to prevent the libtest harness from
286+
accessing the file system. This has no effect unless `-Zmiri-disable-isolation` is also set.
288287
* `-Zmiri-env-forward=<var>` forwards the `var` environment variable to the interpreted program. Can
289288
be used multiple times to forward several variables. This takes precedence over
290289
`-Zmiri-env-exclude`: if a variable is both forwarded and exluced, it *will* get forwarded. This

src/shims/env.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ impl<'tcx> EnvVars<'tcx> {
4242
config: &MiriConfig,
4343
) -> InterpResult<'tcx> {
4444
let target_os = ecx.tcx.sess.target.os.as_ref();
45-
// HACK: Exclude `TERM` var to avoid terminfo trying to open the termcap file.
46-
// This is (a) very slow and (b) does not work on Windows.
4745
let mut excluded_env_vars = config.excluded_env_vars.clone();
48-
excluded_env_vars.push("TERM".to_owned());
46+
if target_os == "windows" {
47+
// HACK: Exclude `TERM` var to avoid terminfo trying to open the termcap file.
48+
excluded_env_vars.push("TERM".to_owned());
49+
}
4950

5051
// Skip the loop entirely if we don't want to forward anything.
5152
if ecx.machine.communicate() || !config.forwarded_env_vars.is_empty() {

0 commit comments

Comments
 (0)