mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-22 19:56:08 +03:00
termio/exec: handle semantic prompt events
This commit is contained in:
@ -483,6 +483,12 @@ pub fn Stream(comptime Handler: type) type {
|
|||||||
} else log.warn("unimplemented OSC callback: {}", .{cmd});
|
} else log.warn("unimplemented OSC callback: {}", .{cmd});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
.end_of_input => {
|
||||||
|
if (@hasDecl(T, "endOfInput")) {
|
||||||
|
try self.handler.endOfInput();
|
||||||
|
} else log.warn("unimplemented OSC callback: {}", .{cmd});
|
||||||
|
},
|
||||||
|
|
||||||
.end_of_command => |end| {
|
.end_of_command => |end| {
|
||||||
if (@hasDecl(T, "endOfCommand")) {
|
if (@hasDecl(T, "endOfCommand")) {
|
||||||
try self.handler.endOfCommand(end.exit_code);
|
try self.handler.endOfCommand(end.exit_code);
|
||||||
|
@ -1235,4 +1235,16 @@ const StreamHandler = struct {
|
|||||||
),
|
),
|
||||||
}, .{ .forever = {} });
|
}, .{ .forever = {} });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn promptStart(self: *StreamHandler) !void {
|
||||||
|
self.terminal.markSemanticPrompt(.prompt);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn promptEnd(self: *StreamHandler) !void {
|
||||||
|
self.terminal.markSemanticPrompt(.input);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn endOfInput(self: *StreamHandler) !void {
|
||||||
|
self.terminal.markSemanticPrompt(.command);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user