Merge pull request #1 from CPunch/main

linux: set console codepage to UTF8
This commit is contained in:
Shylie 2024-03-19 14:44:13 -04:00 committed by GitHub
commit a02ba55ac3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -242,7 +242,7 @@ void terml::setup_buffer()
void terml::set_console_settings() void terml::set_console_settings()
{ {
setvbuf(stdout, nullptr, _IOFBF, BUFSIZ * BUFSIZ); setvbuf(stdout, nullptr, _IOFBF, BUFSIZ * BUFSIZ);
printf(ALT_BUF() HIDE_CURSOR()); printf(ALT_BUF() HIDE_CURSOR() SELECT_UTF8());
fflush(stdout); fflush(stdout);
set_console_settings_impl(); set_console_settings_impl();
} }

View File

@ -16,6 +16,7 @@
#define HIDE_CURSOR() CSI "?25l" #define HIDE_CURSOR() CSI "?25l"
#define SHOW_CURSOR() CSI "?25h" #define SHOW_CURSOR() CSI "?25h"
#define SELECT_UTF8() CSI "%G"
#define REPORT_CUSROR_POSITION() CSI "6n" #define REPORT_CUSROR_POSITION() CSI "6n"
#define CURSOR_POSITION_FORMAT() "%*1s[%u;%u" #define CURSOR_POSITION_FORMAT() "%*1s[%u;%u"