Added macOS file open handler

This commit is contained in:
Qwerasd
2024-01-16 16:26:21 -05:00
parent 771cbea0b0
commit 51f53aa9bf
5 changed files with 50 additions and 14 deletions

View File

@@ -253,6 +253,9 @@ pub const Surface = struct {
/// The working directory to load into.
working_directory: [*:0]const u8 = "",
/// The command to run in the new surface.
command: [*:0]const u8 = "",
};
/// This is the key event sent for ghostty_surface_key.
@@ -326,6 +329,13 @@ pub const Surface = struct {
config.@"working-directory" = wd;
}
// If we have a command from the options then we set it.
const cm = std.mem.sliceTo(opts.command, 0);
if (cm.len > 0) {
// TODO: Maybe add some validation to this, like the working directory has?
config.command = cm;
}
// Initialize our surface right away. We're given a view that is
// ready to use.
try self.core_surface.init(