Skip to content

fix: ensure consistent bash command output across terminal environments #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025

Conversation

ccntrq
Copy link
Contributor

@ccntrq ccntrq commented Jun 18, 2025

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"

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"
 ```
@epage epage merged commit 893b1a5 into rust-cli:main Jun 18, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants