Skip to content

Conversation

@koron
Copy link
Contributor

@koron koron commented Dec 22, 2025

Problem: 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: Conpty now displays error messages in the same way as winpty.

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.

Problem: 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: Conpty now displays error messages in the same way as winpty.

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.

Signed-off-by: MURAOKA Taro <koron.kaoriya@gmail.com>
@koron
Copy link
Contributor Author

koron commented Dec 22, 2025

Example output in Japanese, it says "The system cannot find the file specified".
image

@chrisbra
Copy link
Member

thanks. So we don't have an error message in the terminal itself so that's why the WaitForAsssert call was removed?

@koron
Copy link
Contributor Author

koron commented Dec 23, 2025

So we don't have an error message in the terminal itself so that's why the WaitForAsssert call was removed?

Yes, that's right!

On UNIX, the process is launched after fork(), so it is difficult for Vim to detect this directly. The only way to know that the command process failed to start is via an error message in the terminal buffer.

This means that the implementation of process startup failure detection differs significantly between Windows and UNIX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants