On 24-Dec-2025 07:30, Christian Brabandt wrote:
patch 9.1.2013: tests: Test_terminal_shell_option fails with conpty
Commit:https://github.com/vim/vim/commit/90e17110c476f38ae32449796b65e2a3a62a2827
Author: Muraoka Taro<[email protected]>
Date: Tue Dec 23 20:22:54 2025 +0000
patch 9.1.2013: tests: Test_terminal_shell_option fails with conpty
Problem: tests: When opening a conpty terminal, if process startup
fails, it will silently exit. As a result, the
Test_terminal_shell_option in test_terminal3.vim failed in
conpty.
In a winpty terminal, the winpty-provided error message
"CreateProcess failed" was displayed. The test is designed to
catch this error as an exception.
Solution: Make conpty fail with an error messages in the same way as winpty.
(Muraoka Taro)
In addition, since the GetWin32Error() function can obtain more detailed
error messages, the format has been changed to "CreateProcess failed:
{localized message from the OS}" for conpty.
Also, since the GetWin32Error() function returns errors in ACP (Active
Code Page) encoding, these have been converted to Vim's internal
encoding, enc. This will prevent messages from being garbled in
Japanese environments, etc. The output of this function was basically
used by the semsg() function in other places, so this change also fixes
potential similar garbled characters.
The test now errors out immediately in places where it is expected not
to be reached, and comments have been added about the expected content
of the winpty and conpty error messages.
closes: #18998
Signed-off-by: Muraoka Taro<[email protected]>
Signed-off-by: Christian Brabandt<[email protected]>
After this patch, clang (v21.1.7 on Windows 11 Pro) gives these warnings:
<snip>
clang -c -I. -Iproto -DWIN32 -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00
-DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO
-pipe -Wall -O3 -fomit-frame-pointer -fpie -fPIE -Db_lto=true
-Db_lto_mode=thin -march=native -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD
os_win32.c -o gobjx86-64/os_win32.o
os_win32.c:9097:16: warning: passing 'char *' to parameter of type
'char_u *' (aka 'unsigned char *') converts between pointers to integer
types where one is of the unique plain 'char' type and the other is not
[-Wpointer-sign]
9097 | acp_to_enc(acp_msg, (int)acp_len, &enc_msg, &enc_len);
| ^~~~~~~
proto/winclip.pro:13:25: note: passing argument to parameter 'str' here
13 | void acp_to_enc(char_u *str, int str_size, char_u **out, int
*outlen);
| ^
os_win32.c:9103:26: warning: passing 'char_u *' (aka 'unsigned char *')
to parameter of type 'const char *' converts between pointers to integer
types where one is of the unique plain 'char' type and the other is not
[-Wpointer-sign]
9103 | char *pcrlf = strstr(enc_msg, "\r\n");
| ^~~~~~~
E:/msys64/ucrt64/include/string.h:103:50: note: passing argument to
parameter '_Str' here
103 | _CONST_RETURN char *__cdecl strstr(const char *_Str,const
char *_SubStr);
| ^
os_win32.c:9107:12: warning: assigning to 'char *' from 'char_u *' (aka
'unsigned char *') converts between pointers to integer types where one
is of the unique plain 'char' type and the other is not [-Wpointer-sign]
9107 | oldmsg = enc_msg;
| ^ ~~~~~~~
os_win32.c:9108:12: warning: returning 'char_u *' (aka 'unsigned char
*') from a function with result type 'char *' converts between pointers
to integer types where one is of the unique plain 'char' type and the
other is not [-Wpointer-sign]
9108 | return enc_msg;
| ^~~~~~~
4 warnings generated.
</snip>
Cheers
John
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/5a6705cd-53dc-42ec-9254-4ffbd97309e7%40gmail.com.