From 488585c2a16f7a0982fd05ab1754d6cc788db697 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 15 Jun 2025 23:59:40 +0200 Subject: [PATCH] Force stream out path to be absolute --- tty-fwd/src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tty-fwd/src/main.rs b/tty-fwd/src/main.rs index 8b60eb60..eddc02a6 100644 --- a/tty-fwd/src/main.rs +++ b/tty-fwd/src/main.rs @@ -50,8 +50,8 @@ fn list_sessions(control_path: &Path) -> Result<(), anyhow::Error> { "status": session_info.status, "exit_code": session_info.exit_code, "started_at": session_info.started_at, - "stream-out": stream_out_path.to_string_lossy(), - "stdin": stdin_path.to_string_lossy() + "stream-out": stream_out_path.canonicalize().unwrap_or(stream_out_path.clone()).to_string_lossy(), + "stdin": stdin_path.canonicalize().unwrap_or(stdin_path.clone()).to_string_lossy() }) } else { // Fallback to old behavior if JSON parsing fails @@ -62,8 +62,8 @@ fn list_sessions(control_path: &Path) -> Result<(), anyhow::Error> { }; serde_json::json!({ "status": status, - "stream-out": stream_out_path.to_string_lossy(), - "stdin": stdin_path.to_string_lossy() + "stream-out": stream_out_path.canonicalize().unwrap_or(stream_out_path.clone()).to_string_lossy(), + "stdin": stdin_path.canonicalize().unwrap_or(stdin_path.clone()).to_string_lossy() }) } } else { @@ -75,8 +75,8 @@ fn list_sessions(control_path: &Path) -> Result<(), anyhow::Error> { }; serde_json::json!({ "status": status, - "stream-out": stream_out_path.to_string_lossy(), - "stdin": stdin_path.to_string_lossy() + "stream-out": stream_out_path.canonicalize().unwrap_or(stream_out_path.clone()).to_string_lossy(), + "stdin": stdin_path.canonicalize().unwrap_or(stdin_path.clone()).to_string_lossy() }) };