Skip to content

Commit cf5822a

Browse files
committed
exclude 'TERM' env_var to avoid terminfo trying to open the termcap file
1 parent 2fa0700 commit cf5822a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Several `-Z` flags are relevant for Miri:
166166
* `-Zmiri-disable-stacked-borrows` disables checking the experimental
167167
[Stacked Borrows] aliasing rules. This can make Miri run faster, but it also
168168
means no aliasing violations will be detected.
169-
* `-Zmiri-disable-isolation` disables host host isolation. As a consequence,
169+
* `-Zmiri-disable-isolation` disables host isolation. As a consequence,
170170
the program has access to host resources such as environment variables, file
171171
systems, and randomness.
172172
* `-Zmiri-ignore-leaks` disables the memory leak checker.

src/shims/env.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ pub struct EnvVars<'tcx> {
2424
impl<'tcx> EnvVars<'tcx> {
2525
pub(crate) fn init<'mir>(
2626
ecx: &mut InterpCx<'mir, 'tcx, Evaluator<'tcx>>,
27-
excluded_env_vars: Vec<String>,
27+
mut excluded_env_vars: Vec<String>,
2828
) -> InterpResult<'tcx> {
29+
if ecx.tcx.sess.target.target.target_os.to_lowercase() == "windows" {
30+
// Exclude `TERM` var to avoid terminfo trying to open the termcap file.
31+
excluded_env_vars.push("TERM".to_owned());
32+
}
2933
if ecx.machine.communicate {
3034
let target_os = ecx.tcx.sess.target.target.target_os.as_str();
3135
for (name, value) in env::vars() {

0 commit comments

Comments
 (0)