builtin: fix truncating of EOL on windows terminal (#8338)

pull/8345/head
Swastik Baranwal 2021-01-25 21:21:36 +05:30 committed by GitHub
parent 0a61149476
commit 21ba0470af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -73,8 +73,8 @@ fn builtin_init() {
C.SetConsoleOutputCP(C.CP_UTF8) C.SetConsoleOutputCP(C.CP_UTF8)
C.atexit(restore_codepage) C.atexit(restore_codepage)
if is_atty(1) > 0 { if is_atty(1) > 0 {
C.SetConsoleMode(C.GetStdHandle(C.STD_OUTPUT_HANDLE), C.ENABLE_PROCESSED_OUTPUT | 0x0004) // enable_virtual_terminal_processing C.SetConsoleMode(C.GetStdHandle(C.STD_OUTPUT_HANDLE), C.ENABLE_PROCESSED_OUTPUT | C.ENABLE_WRAP_AT_EOL_OUTPUT | 0x0004) // enable_virtual_terminal_processing
C.SetConsoleMode(C.GetStdHandle(C.STD_ERROR_HANDLE), C.ENABLE_PROCESSED_OUTPUT | 0x0004) // enable_virtual_terminal_processing C.SetConsoleMode(C.GetStdHandle(C.STD_ERROR_HANDLE), C.ENABLE_PROCESSED_OUTPUT | C.ENABLE_WRAP_AT_EOL_OUTPUT | 0x0004) // enable_virtual_terminal_processing
unsafe { unsafe {
C.setbuf(C.stdout, 0) C.setbuf(C.stdout, 0)
C.setbuf(C.stderr, 0) C.setbuf(C.stderr, 0)