╭ changed ────────╮ │src/serve_ssh.zig│ ╰─────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │476 return ssh.formatFingerprint(blob_buf[0..blob_len]); │ │477 } │ │478 │ │479 -// write an error to the client's stderr and exit non-zero. stderr (not stdout) │ │480 -// because the git exec sessions that call this carry the pack protocol on │ │481 -// stdout, where stray text breaks the client's pkt-line parser. │ │479 fn writeError(sess: *ssh.SessionCtx, comptime msg: []const u8) !void { │ │483 - try sess.writeStderr("haxy ssh: " ++ msg ++ "\n"); │ │480 + const body = "ERR haxy ssh: " ++ msg; │ │481 + var packet: [body.len + 4]u8 = undefined; │ │482 + const line = try std.fmt.bufPrint(&packet, "{x:0>4}{s}", .{ packet.len, body });│ │483 + try sess.writeBytes(line); │ │484 try sess.exit(1); │ │485 } │ │486 │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯