ssh remote: Stream stderr from server via proxy to client (#19073)

Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
This commit is contained in:
Thorsten Ball 2024-10-11 17:11:20 +02:00 committed by GitHub
parent d976c5f1b6
commit c21f26c419
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 220 additions and 97 deletions

View file

@ -836,8 +836,7 @@ impl SshRemoteClient {
let line_ix = start_ix + ix;
let content = &stderr_buffer[start_ix..line_ix];
start_ix = line_ix + 1;
if let Ok(mut record) = serde_json::from_slice::<LogRecord>(content) {
record.message = format!("(remote) {}", record.message);
if let Ok(record) = serde_json::from_slice::<LogRecord>(content) {
record.log(log::logger())
} else {
eprintln!("(remote) {}", String::from_utf8_lossy(content));