| /* vi:set ts=8 sts=4 sw=4 noet: |
| * |
| * VIM - Vi IMproved by Bram Moolenaar |
| * |
| * Fuchsia port by Adam Barth |
| * |
| * Do ":help uganda" in Vim to read copying and usage conditions. |
| * Do ":help credits" in Vim to see a list of people who contributed. |
| */ |
| |
| #include "vim.h" |
| |
| #include <fuchsia/hardware/pty/c/fidl.h> |
| #include <lib/fdio/unsafe.h> |
| |
| /* |
| * Get the current window size in Rows and Columns. |
| */ |
| int |
| mch_get_shellsize(void) |
| { |
| if (!isatty(STDIN_FILENO)) { |
| return -1; |
| } |
| |
| fdio_t* io = fdio_unsafe_fd_to_io(STDIN_FILENO); |
| fuchsia_hardware_pty_WindowSize wsz; |
| zx_status_t status; |
| zx_status_t call_status = fuchsia_hardware_pty_DeviceGetWindowSize( |
| fdio_unsafe_borrow_channel(io), &status, &wsz); |
| fdio_unsafe_release(io); |
| if (call_status != ZX_OK || status != ZX_OK) { |
| return -1; |
| } |
| Columns = wsz.height; |
| Rows = wsz.width; |
| return OK; |
| } |
| |
| void |
| mch_settmode(int tmode) |
| { |
| // TODO(abarth): Implement. |
| } |
| |
| void |
| get_stty(void) |
| { |
| // TODO(abarth): Implement. |
| } |