From e0a733584eb469eda897a90a7bb4d27d745310a4 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 13 Nov 2024 12:55:43 -0800 Subject: [PATCH] libghostty: remove the pwd function --- include/ghostty.h | 1 - src/apprt/embedded.zig | 19 ------------------- 2 files changed, 20 deletions(-) diff --git a/include/ghostty.h b/include/ghostty.h index cc6cb7cf8..41e3b3fe2 100644 --- a/include/ghostty.h +++ b/include/ghostty.h @@ -712,7 +712,6 @@ void ghostty_surface_complete_clipboard_request(ghostty_surface_t, const char*, void*, bool); -uintptr_t ghostty_surface_pwd(ghostty_surface_t, char*, uintptr_t); bool ghostty_surface_has_selection(ghostty_surface_t); uintptr_t ghostty_surface_selection(ghostty_surface_t, char*, uintptr_t); diff --git a/src/apprt/embedded.zig b/src/apprt/embedded.zig index 4d45166aa..9f0b2a2a4 100644 --- a/src/apprt/embedded.zig +++ b/src/apprt/embedded.zig @@ -1428,25 +1428,6 @@ pub const CAPI = struct { return selection.len; } - /// Copies the surface working directory into the provided buffer and - /// returns the copied size. If the buffer is too small, there is no pwd, - /// or there is an error, then 0 is returned. - export fn ghostty_surface_pwd(surface: *Surface, buf: [*]u8, cap: usize) usize { - const pwd_ = surface.core_surface.pwd(global.alloc) catch |err| { - log.warn("error getting pwd err={}", .{err}); - return 0; - }; - const pwd = pwd_ orelse return 0; - defer global.alloc.free(pwd); - - // If the buffer is too small, return no pwd. - if (pwd.len > cap) return 0; - - // Copy into the buffer and return the length - @memcpy(buf[0..pwd.len], pwd); - return pwd.len; - } - /// Tell the surface that it needs to schedule a render export fn ghostty_surface_refresh(surface: *Surface) void { surface.refresh();