╭ changed ────────╮ │src/serve_ssh.zig│ ╰─────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │272 if (ui_session.host_request) |request| { │ │273 ui_session.host_request = null; │ │274 switch (request) { │ │275 - .show_url => |url| { │ │275 + .show_copyable_text => |copyable_text| { │ │276 if (terminal_maybe) |*terminal| terminal.deinit(); │ │277 terminal_maybe = null; │ │278 - try session_writer.interface.print("\x1b[2J\x1b[H{s}\r\n\r\npress enter to go back\r\n", .{url}); │ │278 + try session_writer.interface.print("\x1b[2J\x1b[Hcopy the following text and then press enter to go back:\r\n\r\n{s}\r\n", .{copyable_text});│ │279 try session_writer.interface.flush(); │ │280 continue; │ │281 }, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │968 // port the web UI is served on, for the TUI/SSH footer's "http://localhost:<port>..."│ │969 // url. null on the web itself (no footer there). │ │970 web_port: ?u16 = null, │ │971 - // a host operation requested by a widget. terminals present urls on │ │971 + // a host operation requested by a widget. terminals present copyable text on │ │972 // their restored screen; wasm asks the browser to copy them. │ │973 host_request: ?HostRequest = null, │ │974 quit_requested: bool = false, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────╮ │975 │ │976 pub const HostRequest = union(enum) {│ │977 - show_url: []const u8, │ │977 + show_copyable_text: []const u8, │ │978 }; │ │979 │ │980 const Self = @This(); │ ╰──────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────╮ │1144 if (session.host_request) |request| { │ │1145 session.host_request = null; │ │1146 switch (request) { │ │1147 - .show_url => |url| { │ │1147 + .show_copyable_text => |copyable_text| {│ │1148 term.setActive(null); │ │1149 terminal.deinit(io); │ │1150 terminal_live = false; │ ╰──────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │1151 - showUrl(io, url) catch |show_err| { │ │1151 + showCopyableText(io, copyable_text) catch |show_err| {│ │1152 terminal = try term.Terminal.init(io, allocator); │ │1153 terminal_live = true; │ │1154 term.setActive(&terminal); │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │1185 } │ │1186 } │ │1187 │ │1188 -fn showUrl(io: std.Io, url: []const u8) !void { │ │1188 +fn showCopyableText(io: std.Io, copyable_text: []const u8) !void {│ │1189 const tty: ?std.Io.File = if (builtin.os.tag == .windows) │ │1190 null │ │1191 else │ ╰────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1197 │ │1198 var write_buf: [1024]u8 = undefined; │ │1199 var writer = output.writer(io, &write_buf); │ │1200 - try writer.interface.print("\x1b[2J\x1b[H{s}\r\n\r\npress enter to go back\r\n", .{url}); │ │1200 + try writer.interface.print("\x1b[2J\x1b[Hcopy the following text and then press enter to go back:\r\n\r\n{s}\r\n", .{copyable_text});│ │1201 try writer.interface.flush(); │ │1202 │ │1203 var read_buf: [1]u8 = undefined; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2185 .mouse => |mouse| { │ │2186 if (mouse.ctrl or !inp.leftClickOn(root_focus, self.getFocus().id, mouse)) return; │ │2187 const rect = (root_focus.children.get(self.getFocus().id) orelse return).rect; │ │2188 - if (mouse.x < rect.x + self.url_width) self.session.host_request = .{ .show_url = self.url }; │ │2188 + if (mouse.x < rect.x + self.url_width) self.session.host_request = .{ .show_copyable_text = self.url };│ │2189 }, │ │2190 else => {}, │ │2191 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────╮ │src/ui/CloneUrl.zig│ ╰───────────────────╯ ╭──────────────────────────────────────╮ │1 const std = @import("std"); │ │2 +const builtin = @import("builtin");│ │3 const ui = @import("../ui.zig"); │ │4 const xit = @import("xit"); │ │5 const xitui = xit.xitui; │ ╰──────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │20 const Protocol = struct { │ │21 name: []const u8, │ │22 url: []const u8, │ │23 + copyable_text: []const u8, │ │24 }; │ │25 │ │26 pub fn init(allocator: std.mem.Allocator, session: *ui.Session, identity: []const u8) !View {│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯