To: vim_dev@googlegroups.com Subject: Patch 8.2.3043 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3043 Problem: Amiga: cannot get the shell size on MorphOS and AROS. Solution: Use control sequences. (Ola Söder, closes #8438) Files: src/os_amiga.c *** ../vim-8.2.3042/src/os_amiga.c 2021-06-23 15:52:39.974570654 +0200 --- src/os_amiga.c 2021-06-23 22:03:55.975675449 +0200 *************** *** 1008,1014 **** #endif /* ! * try to get the real window size * return FAIL for failure, OK otherwise */ int --- 1008,1065 ---- #endif /* ! * Get console size in a system friendly way on AROS and MorphOS. ! * Return FAIL for failure, OK otherwise ! */ ! #if defined(__AROS__) || defined(__MORPHOS__) ! int ! mch_get_shellsize(void) ! { ! if (!term_console) ! return FAIL; ! ! if (raw_in && raw_out) ! { ! // Save current console mode. ! int old_tmode = cur_tmode; ! char ctrl[] = "\x9b""0 q"; ! ! // Set RAW mode. ! mch_settmode(TMODE_RAW); ! ! // Write control sequence to console. ! if (Write(raw_out, ctrl, sizeof(ctrl)) == sizeof(ctrl)) ! { ! char scan[] = "\x9b""1;1;%d;%d r", ! answ[sizeof(scan) + 8] = { '\0' }; ! ! // Read return sequence from input. ! if (Read(raw_in, answ, sizeof(answ) - 1) > 0) ! { ! // Parse result and set Vim globals. ! if (sscanf(answ, scan, &Rows, &Columns) == 2) ! { ! // Restore console mode. ! mch_settmode(old_tmode); ! return OK; ! } ! } ! } ! ! // Restore console mode. ! mch_settmode(old_tmode); ! } ! ! // I/O error. Default size fallback. ! term_console = FALSE; ! Columns = 80; ! Rows = 24; ! ! return FAIL; ! } ! #else ! /* ! * Try to get the real window size, * return FAIL for failure, OK otherwise */ int *************** *** 1040,1052 **** OUT_STR("\233t\233u"); // CSI t CSI u out_flush(); - #ifdef __AROS__ - if (!Info(raw_out, id) - || (wb_window = (struct Window *) id->id_VolumeNode) == NULL) - #else if (dos_packet(MP(raw_out), (long)ACTION_DISK_INFO, ((ULONG) id) >> 2) == 0 || (wb_window = (struct Window *)id->id_VolumeNode) == NULL) - #endif { // it's not an amiga window, maybe aux device // terminal type should be set --- 1091,1098 ---- *************** *** 1081,1086 **** --- 1127,1133 ---- return FAIL; } + #endif /* * Try to set the real window size to Rows and Columns. *** ../vim-8.2.3042/src/version.c 2021-06-23 21:44:03.249880242 +0200 --- src/version.c 2021-06-23 22:01:51.111934182 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3043, /**/ -- I'm not familiar with this proof, but I'm aware of a significant following of toddlers who believe that peanut butter is the solution to all of life's problems... -- Tim Hammerquist /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///