Skip to content

Commit

Permalink
Enable input buffering to improve keypress handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
MockbaTheBorg committed Jul 25, 2024
1 parent 7d1375e commit 19583ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions RunCPM/abstraction_posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ void _console_init(void) {

tcsetattr(0, TCSANOW, &_new_term); /* Apply changes immediately */

setvbuf(stdin, (char*)NULL, _IONBF, 256); /* Enable stdin buffering */
setvbuf(stdout, (char*)NULL, _IONBF, 0); /* Disable stdout buffering */
}

Expand Down
1 change: 1 addition & 0 deletions RunCPM/abstraction_vstudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ void _console_init(void) {
SetConsoleMode(hInHandle, cInMode | ENABLE_VIRTUAL_TERMINAL_INPUT);
SetConsoleTitle("RunCPM v" VERSION);

setvbuf(stdin, NULL, _IONBF, 256);
setvbuf(stdout, NULL, _IONBF, 0);

if(!SetConsoleCtrlHandler((PHANDLER_ROUTINE)_signal_handler, TRUE)) {
Expand Down

0 comments on commit 19583ea

Please sign in to comment.