some logging improvements

This commit is contained in:
Mitchell Hashimoto
2022-08-03 21:13:05 -07:00
parent b2a9f1f79e
commit 1680aee880
3 changed files with 5 additions and 3 deletions

View File

@ -16,7 +16,6 @@ const libuv = @import("libuv/main.zig");
const Pty = @import("Pty.zig");
const Command = @import("Command.zig");
const SegmentedPool = @import("segmented_pool.zig").SegmentedPool;
const frame = @import("tracy/tracy.zig").frame;
const trace = @import("tracy/tracy.zig").trace;
const max_timer = @import("max_timer.zig");
const terminal = @import("terminal/main.zig");

View File

@ -77,7 +77,7 @@ pub fn init(alloc: Allocator, cols: usize, rows: usize) !Terminal {
.rows = rows,
.active_screen = .primary,
// TODO: configurable scrollback
.screen = try Screen.init(alloc, rows, cols, 1000),
.screen = try Screen.init(alloc, rows, cols, 10000),
// No scrollback for the alternate screen
.secondary_screen = try Screen.init(alloc, rows, cols, 0),
.tabstops = try Tabstops.init(alloc, cols, TABSTOP_INTERVAL),

View File

@ -43,14 +43,17 @@ pub fn Stream(comptime Handler: type) type {
/// Process the next character and call any callbacks if necessary.
pub fn next(self: *Self, c: u8) !void {
const tracy = trace(@src());
tracy.value(@intCast(u64, c));
defer tracy.end();
//log.debug("char: {x}", .{c});
const actions = self.parser.next(c);
for (actions) |action_opt| {
if (action_opt) |action| {
if (action != .print) {
log.info("action: {}", .{action});
}
}
switch (action_opt orelse continue) {
.print => |p| if (@hasDecl(T, "print")) try self.handler.print(p),
.execute => |code| try self.execute(code),