To: vim_dev@googlegroups.com Subject: Patch 8.0.09 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0949 Problem: winpty.dll name is fixed. Solution: Add the 'winptydll' option. Make the default name depend on whether it is a 32-bit or 64-bit build. (idea by Yasuhiro Matsumoto, closes #1978) Files: src/option.c, src/option.h, src/terminal.c, runtime/doc/options.txt *** ../vim-8.0.0948/src/option.c 2017-08-14 22:35:04.676303049 +0200 --- src/option.c 2017-08-16 23:00:46.528104714 +0200 *************** *** 3098,3103 **** --- 3098,3117 ---- (char_u *)NULL, PV_NONE, #endif {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, + {"winptydll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, + #if defined(WIN3264) && defined(TERMINAL) + (char_u *)&p_winptydll, PV_NONE, { + # ifdef _WIN64 + (char_u *)"winpty64.dll", + # else + (char_u *)"winpty32.dll", + # endif + (char_u *)0L} + #else + (char_u *)NULL, PV_NONE, + {(char_u *)0L, (char_u *)0L} + #endif + SCRIPTID_INIT}, {"winwidth", "wiw", P_NUM|P_VI_DEF, #ifdef FEAT_WINDOWS (char_u *)&p_wiw, PV_NONE, *** ../vim-8.0.0948/src/option.h 2017-08-03 22:44:51.038797722 +0200 --- src/option.h 2017-08-16 23:02:55.503296837 +0200 *************** *** 966,971 **** --- 966,974 ---- EXTERN long p_wmw; /* 'winminwidth' */ EXTERN long p_wiw; /* 'winwidth' */ #endif + #if defined(WIN3264) && defined(TERMINAL) + EXTERN char_u *p_winptydll; /* 'winptydll' */ + #endif EXTERN int p_ws; /* 'wrapscan' */ EXTERN int p_write; /* 'write' */ EXTERN int p_wa; /* 'writeany' */ *** ../vim-8.0.0948/src/terminal.c 2017-08-14 22:56:22.612514086 +0200 --- src/terminal.c 2017-08-16 23:05:48.346214799 +0200 *************** *** 38,43 **** --- 38,44 ---- * in tl_scrollback are no longer used. * * TODO: + * - make [range]terminal pipe [range] lines to the terminal * - implement term_setsize() * - add test for giving error for invalid 'termsize' value. * - support minimal size when 'termsize' is "rows*cols". *************** *** 2768,2778 **** /* No need to initialize twice. */ if (hWinPtyDLL) return 1; ! /* Load winpty.dll */ ! hWinPtyDLL = vimLoadLib(WINPTY_DLL); if (!hWinPtyDLL) { ! EMSG2(_(e_loadlib), WINPTY_DLL); return 0; } for (i = 0; winpty_entry[i].name != NULL --- 2769,2783 ---- /* No need to initialize twice. */ if (hWinPtyDLL) return 1; ! /* Load winpty.dll, prefer using the 'winptydll' option, fall back to just ! * winpty.dll. */ ! if (*p_winptydll != NUL) ! hWinPtyDLL = vimLoadLib((char *)p_winptydll); ! if (!hWinPtyDLL) ! hWinPtyDLL = vimLoadLib(WINPTY_DLL); if (!hWinPtyDLL) { ! EMSG2(_(e_loadlib), *p_winptydll != NUL ? p_winptydll : WINPTY_DLL); return 0; } for (i = 0; winpty_entry[i].name != NULL *** ../vim-8.0.0948/runtime/doc/options.txt 2017-07-23 19:50:39.028922806 +0200 --- runtime/doc/options.txt 2017-08-16 23:08:35.817167031 +0200 *************** *** 8694,8699 **** --- 8819,8838 ---- large number, it will cause errors when opening more than a few windows. A value of 0 to 12 is reasonable. + *'winptydll'* + 'winptydll' string (default "winpty32.dll" or "winpty64.dll") + global + {not in Vi} + {only available when compiled with the |terminal| + feature on MS-Windows} + Specifies the name of the winpty shared library, used for the + |:terminal| command. The default depends on whether was build as a + 32-bit or 64-bit executable. If not found, "win32pty.dll" is tried as + a fallback. + Environment variables are expanded |:set_env|. + This option cannot be set from a |modeline| or in the |sandbox|, for + security reasons. + *'winwidth'* *'wiw'* *E592* 'winwidth' 'wiw' number (default 20) global *** ../vim-8.0.0948/src/version.c 2017-08-16 22:45:57.689683993 +0200 --- src/version.c 2017-08-16 23:09:16.224914317 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 949, /**/ -- ./configure Checking whether build environment is sane ... build environment is grinning and holding a spatula. Guess not. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///