mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
libghostty: remove the pwd function
This commit is contained in:
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user