Skip to content

Commit 0281bed

Browse files
committed
fix: ensure consistent bash command output across terminal environments
The output from `spawn_bash` was inconsistent depending on the terminal environment where the process was spawned. In tmux and other advanced terminals, the output included ANSI control sequences for features like bracketed paste mode, causing test failures and unreliable behavior. Set TERM="" when spawning bash to force a dumb terminal mode, ensuring clean, consistent output regardless of the parent terminal environment. Example error: ``` thread 'session::tests::test_bash' panicked at src/session.rs:542:9: assertion `left == right` failed left: "/tmp\r\n" right: "\u{1b}[?2004l\r\r\n/tmp\r\n\u{1b}[?2004h" ```
1 parent ebb90a9 commit 0281bed

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/session.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ pub fn spawn_bash(timeout: Option<u64>) -> Result<PtyReplSession, Error> {
397397
unset PROMPT_COMMAND\n",
398398
)?;
399399
let mut c = Command::new("bash");
400+
c.env("TERM", "");
400401
c.args([
401402
"--rcfile",
402403
rcfile.path().to_str().unwrap_or("temp file does not exist"),

0 commit comments

Comments
 (0)