mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 13:16:11 +03:00
terminal/new: set/gwd pwd
This commit is contained in:
@ -2070,6 +2070,19 @@ fn clearPromptForResize(self: *Terminal) void {
|
|||||||
_ = self;
|
_ = self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set the pwd for the terminal.
|
||||||
|
pub fn setPwd(self: *Terminal, pwd: []const u8) !void {
|
||||||
|
self.pwd.clearRetainingCapacity();
|
||||||
|
try self.pwd.appendSlice(pwd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns the pwd for the terminal, if any. The memory is owned by the
|
||||||
|
/// Terminal and is not copied. It is safe until a reset or setPwd.
|
||||||
|
pub fn getPwd(self: *const Terminal) ?[]const u8 {
|
||||||
|
if (self.pwd.items.len == 0) return null;
|
||||||
|
return self.pwd.items;
|
||||||
|
}
|
||||||
|
|
||||||
/// Options for switching to the alternate screen.
|
/// Options for switching to the alternate screen.
|
||||||
pub const AlternateScreenOptions = struct {
|
pub const AlternateScreenOptions = struct {
|
||||||
cursor_save: bool = false,
|
cursor_save: bool = false,
|
||||||
|
Reference in New Issue
Block a user