libghostty: remove the pwd function

This commit is contained in:
Mitchell Hashimoto
2024-11-13 12:55:43 -08:00
parent e724c46c64
commit e0a733584e
2 changed files with 0 additions and 20 deletions

View File

@ -712,7 +712,6 @@ void ghostty_surface_complete_clipboard_request(ghostty_surface_t,
const char*, const char*,
void*, void*,
bool); bool);
uintptr_t ghostty_surface_pwd(ghostty_surface_t, char*, uintptr_t);
bool ghostty_surface_has_selection(ghostty_surface_t); bool ghostty_surface_has_selection(ghostty_surface_t);
uintptr_t ghostty_surface_selection(ghostty_surface_t, char*, uintptr_t); uintptr_t ghostty_surface_selection(ghostty_surface_t, char*, uintptr_t);

View File

@ -1428,25 +1428,6 @@ pub const CAPI = struct {
return selection.len; 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 /// Tell the surface that it needs to schedule a render
export fn ghostty_surface_refresh(surface: *Surface) void { export fn ghostty_surface_refresh(surface: *Surface) void {
surface.refresh(); surface.refresh();