diff options
author | Ron Yorston <rmy@pobox.com> | 2016-08-02 15:53:24 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2016-08-02 15:53:24 +0100 |
commit | 759188eae5651f1fbca45be310b0b9b46d876080 (patch) | |
tree | 7e2cda8242feb743f49a55e30f521b0c8d0c22c5 /win32/winansi.c | |
parent | 31277ab7e6e0a8385a35138d9d2d5168ecadec87 (diff) | |
download | busybox-w32-759188eae5651f1fbca45be310b0b9b46d876080.tar.gz busybox-w32-759188eae5651f1fbca45be310b0b9b46d876080.tar.bz2 busybox-w32-759188eae5651f1fbca45be310b0b9b46d876080.zip |
stty: changes required to build for WIN32
Diffstat (limited to 'win32/winansi.c')
-rw-r--r-- | win32/winansi.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/win32/winansi.c b/win32/winansi.c index c0493c77e..757a3509d 100644 --- a/win32/winansi.c +++ b/win32/winansi.c | |||
@@ -596,6 +596,23 @@ int winansi_get_terminal_width_height(struct winsize *win) | |||
596 | return ret ? 0 : -1; | 596 | return ret ? 0 : -1; |
597 | } | 597 | } |
598 | 598 | ||
599 | int winansi_set_terminal_width_height(struct winsize *win) | ||
600 | { | ||
601 | BOOL ret; | ||
602 | CONSOLE_SCREEN_BUFFER_INFOEX sbi; | ||
603 | |||
604 | init(); | ||
605 | |||
606 | sbi.cbSize = sizeof(sbi); | ||
607 | if ((ret=GetConsoleScreenBufferInfoEx(console, &sbi)) != 0) { | ||
608 | sbi.srWindow.Bottom = sbi.srWindow.Top + win->ws_row; | ||
609 | sbi.srWindow.Right = sbi.srWindow.Left + win->ws_col; | ||
610 | ret = SetConsoleScreenBufferInfoEx(console, &sbi); | ||
611 | } | ||
612 | |||
613 | return ret ? 0 : -1; | ||
614 | } | ||
615 | |||
599 | static int ansi_emulate_write(int fd, const void *buf, size_t count) | 616 | static int ansi_emulate_write(int fd, const void *buf, size_t count) |
600 | { | 617 | { |
601 | int rv = 0, i; | 618 | int rv = 0, i; |