core: add Surface.stopProcess
This keeps the IO backend interaction inside of the owning Surface code.pull/9760/head
parent
93af8c8955
commit
9fe900aa01
|
|
@ -851,6 +851,14 @@ pub fn close(self: *Surface) void {
|
|||
self.rt_surface.close(self.needsConfirmQuit());
|
||||
}
|
||||
|
||||
/// Stop the child process by sending it the kill command (SIGHUP).
|
||||
/// child_exited will be set once the child process has stopped.
|
||||
pub fn stopProcess(self: *Surface) void {
|
||||
switch (self.io.backend) {
|
||||
.exec => |*exec| exec.subprocess.stop(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a mailbox that can be used to send messages to this surface.
|
||||
inline fn surfaceMailbox(self: *Surface) Mailbox {
|
||||
return .{
|
||||
|
|
|
|||
|
|
@ -1602,9 +1602,7 @@ pub const CAPI = struct {
|
|||
|
||||
/// Stops the child process by sending it the kill command (SIGHUP).
|
||||
export fn ghostty_surface_process_stop(surface: *Surface) void {
|
||||
switch (surface.core_surface.io.backend) {
|
||||
.exec => |*exec| exec.subprocess.stop(),
|
||||
}
|
||||
surface.core_surface.stopProcess();
|
||||
}
|
||||
|
||||
/// Returns true if the surface has a selection.
|
||||
|
|
|
|||
Loading…
Reference in New Issue