Skip to content

Commit 3c5cb89

Browse files
committed
exclude TERM by default
1 parent 27d5b84 commit 3c5cb89

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,9 @@ environment variable:
254254
`warn` prints a full backtrace when that happen; `warn-nobacktrace` is less
255255
verbose. `hide` hides the warning entirely.
256256
* `-Zmiri-env-exclude=<var>` keeps the `var` environment variable isolated from the host so that it
257-
cannot be accessed by the program. Can be used multiple times to exclude several variables. On
258-
Windows, the `TERM` environment variable is excluded by default. This has no effect unless
257+
cannot be accessed by the program. Can be used multiple times to exclude several variables. The
258+
`TERM` environment variable is excluded by default to [speed up the test
259+
harness](https://github.com/rust-lang/miri/issues/1702). This has no effect unless
259260
`-Zmiri-disable-validation` is also set.
260261
* `-Zmiri-env-forward=<var>` forwards the `var` environment variable to the interpreted program. Can
261262
be used multiple times to forward several variables. This has no effect if

src/shims/env.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ impl<'tcx> EnvVars<'tcx> {
4242
forwarded_env_vars: Vec<String>,
4343
) -> InterpResult<'tcx> {
4444
let target_os = ecx.tcx.sess.target.os.as_str();
45-
if target_os == "windows" {
46-
// Temporary hack: Exclude `TERM` var to avoid terminfo trying to open the termcap file.
47-
// Can be removed once https://github.com/rust-lang/miri/issues/1013 is resolved.
48-
excluded_env_vars.push("TERM".to_owned());
49-
}
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.
47+
excluded_env_vars.push("TERM".to_owned());
5048

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

0 commit comments

Comments
 (0)