Skip to content

Commit

Permalink
fix: set TERM for bash, and zsh
Browse files Browse the repository at this point in the history
To prevent duplicated bash/zsh prompt.
  • Loading branch information
tesuji committed Jun 30, 2024
1 parent 4334bff commit 0eeb4e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/completest-pty/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ PROMPT='%% '
pub fn complete(&mut self, input: &str, term: &Term) -> std::io::Result<String> {
let mut command = Command::new("zsh");
command.arg("--noglobalrcs");
command.env("PATH", &self.path).env("ZDOTDIR", &self.home);
command
.env("PATH", &self.path)
.env("TERM", "dumb")
.env("ZDOTDIR", &self.home);
let echo = false;
comptest(command, echo, input, term, self.timeout)
}
Expand Down Expand Up @@ -219,6 +222,7 @@ PS1='% '
let inputrc_path = self.home.join(".inputrc");
command
.env("PATH", &self.path)
.env("TERM", "dumb")
.env("INPUTRC", &inputrc_path)
.args([OsStr::new("--rcfile"), self.config.as_os_str()]);
let echo = !input.contains("\t\t");
Expand Down

0 comments on commit 0eeb4e3

Please sign in to comment.