mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 05:50:27 +00:00
Added macOS file open handler
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user