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() }) };