fix(core): fix terminal output for non-tui (#30957)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> vt100 does not work for non TUI ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> do not use vt100 for printing to stdout. vt100 is still used for the TUI terminal panes. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
This commit is contained in:
parent
0f4c085297
commit
fa92c4025e
@ -110,14 +110,20 @@ impl PseudoTerminal {
|
||||
trace!("Quiet: {}", quiet);
|
||||
debug!("Read {} bytes", len);
|
||||
if let Ok(mut parser) = parser_clone.write() {
|
||||
let prev = parser.screen().clone();
|
||||
|
||||
parser.process(&buf[..len]);
|
||||
debug!("{}", parser.get_raw_output().len());
|
||||
|
||||
let write_buf = parser.screen().contents_diff(&prev);
|
||||
if !quiet {
|
||||
let mut logged_interrupted_error = false;
|
||||
|
||||
let mut content = String::from_utf8_lossy(&buf[0..len]).to_string();
|
||||
if content.contains("\x1B[6n") {
|
||||
trace!("Prevented terminal escape sequence ESC[6n from being printed.");
|
||||
content = content.replace("\x1B[6n", "");
|
||||
}
|
||||
|
||||
let write_buf = content.as_bytes();
|
||||
debug!("Escaped Stdout: {:?}", write_buf.escape_ascii().to_string());
|
||||
|
||||
while let Err(e) = stdout.write_all(&write_buf) {
|
||||
match e.kind() {
|
||||
std::io::ErrorKind::Interrupted => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user