diff --git a/README.md b/README.md index 23d82ef..a0ae101 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,11 @@ It contains information about me and my projects as well as blog entries about s - [ ] How can I support to run a sub-process inside of a given pane / layout? - [ ] Create demo gifs using [vhs](https://github.com/charmbracelet/vhs) +- [ ] How would I measure my FPS? +- [ ] Could I simulate a corresponding event loop? + - empty user event + - emmit as many as possible through another thread (until the event queue is full?) + - see how fast the application can render each frame and measure the necessary time for each _frame_? + -> determine statistics like, min, max, median, mean, etc. + -> Or buffered writer to the `std.posix.STDOUT_FILENO`? + -> I could use this to see if it makes sense to implement a buffered version using a screen buffer (to only render the differences?) diff --git a/src/terminal.zig b/src/terminal.zig index 3774da9..5ac995e 100644 --- a/src/terminal.zig +++ b/src/terminal.zig @@ -137,13 +137,30 @@ pub fn enableRawMode(bak: *std.posix.termios) !void { var termios = try std.posix.tcgetattr(std.posix.STDIN_FILENO); bak.* = termios; - termios.iflag.IXON = false; + // termios flags used by termios(3) + termios.iflag.IGNBRK = false; + termios.iflag.BRKINT = false; + termios.iflag.PARMRK = false; + termios.iflag.ISTRIP = false; + termios.iflag.INLCR = false; + termios.iflag.IGNCR = false; termios.iflag.ICRNL = false; + termios.iflag.IXON = false; + + // messes with output -> not used + // termios.oflag.OPOST = false; termios.lflag.ECHO = false; + termios.lflag.ECHONL = false; termios.lflag.ICANON = false; - termios.lflag.IEXTEN = false; termios.lflag.ISIG = false; + termios.lflag.IEXTEN = false; + + termios.cflag.CSIZE = .CS8; + termios.cflag.PARENB = false; + + termios.cc[@intFromEnum(std.posix.V.MIN)] = 1; + termios.cc[@intFromEnum(std.posix.V.TIME)] = 0; try std.posix.tcsetattr( std.posix.STDIN_FILENO,