mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
termio: changeConfig on reader data
This commit is contained in:
@ -7,6 +7,7 @@ pub const reader = @import("termio/reader.zig");
|
||||
pub const Options = @import("termio/Options.zig");
|
||||
pub const Termio = @import("termio/Termio.zig");
|
||||
pub const Thread = @import("termio/Thread.zig");
|
||||
pub const DerivedConfig = Termio.DerivedConfig;
|
||||
pub const Mailbox = Thread.Mailbox;
|
||||
|
||||
test {
|
||||
|
@ -378,13 +378,7 @@ pub fn changeConfig(self: *Termio, td: *ThreadData, config: *DerivedConfig) !voi
|
||||
// renderer mutex so this is safe to do despite being executed
|
||||
// from another thread.
|
||||
td.ev.terminal_stream.handler.changeConfig(&self.config);
|
||||
switch (td.reader) {
|
||||
.manual => {},
|
||||
.exec => |*exec| {
|
||||
exec.abnormal_runtime_threshold_ms = config.abnormal_runtime_threshold_ms;
|
||||
exec.wait_after_command = config.wait_after_command;
|
||||
},
|
||||
}
|
||||
td.reader.changeConfig(&self.config);
|
||||
|
||||
// Update the configuration that we know about.
|
||||
//
|
||||
|
@ -1,5 +1,6 @@
|
||||
const std = @import("std");
|
||||
const configpkg = @import("../config.zig");
|
||||
const termio = @import("../termio.zig");
|
||||
const Command = @import("../Command.zig");
|
||||
|
||||
/// The kinds of readers.
|
||||
@ -45,4 +46,14 @@ pub const ThreadData = union(Kind) {
|
||||
/// to close the surface.
|
||||
wait_after_command: bool,
|
||||
},
|
||||
|
||||
pub fn changeConfig(self: *ThreadData, config: *termio.DerivedConfig) void {
|
||||
switch (self.*) {
|
||||
.manual => {},
|
||||
.exec => |*exec| {
|
||||
exec.abnormal_runtime_threshold_ms = config.abnormal_runtime_threshold_ms;
|
||||
exec.wait_after_command = config.wait_after_command;
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user