Skip to content

Commit 0eeb4e3

Browse files
committed
fix: set TERM for bash, and zsh
To prevent duplicated bash/zsh prompt.
1 parent 4334bff commit 0eeb4e3

File tree

1 file changed

+5
-1
lines changed
  • crates/completest-pty/src

1 file changed

+5
-1
lines changed

crates/completest-pty/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ PROMPT='%% '
113113
pub fn complete(&mut self, input: &str, term: &Term) -> std::io::Result<String> {
114114
let mut command = Command::new("zsh");
115115
command.arg("--noglobalrcs");
116-
command.env("PATH", &self.path).env("ZDOTDIR", &self.home);
116+
command
117+
.env("PATH", &self.path)
118+
.env("TERM", "dumb")
119+
.env("ZDOTDIR", &self.home);
117120
let echo = false;
118121
comptest(command, echo, input, term, self.timeout)
119122
}
@@ -219,6 +222,7 @@ PS1='% '
219222
let inputrc_path = self.home.join(".inputrc");
220223
command
221224
.env("PATH", &self.path)
225+
.env("TERM", "dumb")
222226
.env("INPUTRC", &inputrc_path)
223227
.args([OsStr::new("--rcfile"), self.config.as_os_str()]);
224228
let echo = !input.contains("\t\t");

0 commit comments

Comments
 (0)