Hi,

When win32 vim.exe is executed on mintty (which is the default terminal emulator
on Cygwin/MSYS2), vim.exe hangs up because mintty (more precisely, cygwin pty)
is not compatible with Command Prompt.
Cygwin and MSYS2 have own versions of Vim, so people should use these versions
on mintty. However if someone runs win32 vim.exe on mintty by mistake, the
problem occurs. This is very bad user experience. Hang-up should be avoided.

I propose a patch to detect mintty with the win32 version of vim.
When the vim.exe detects mintty, it outputs an error message and exits soon
unless the option --not-a-term is specified.

  
https://bitbucket.org/k_takata/vim-ktakata-mq/src/tip/add-check-for-cygwin-pty.patch

This uses a detection routine from my small project:
  https://github.com/k-takata/ptycheck
iscygpty.{c,h} are intended to be used as a library.
(I created this mainly for Vim, but not limited to Vim. So it is MIT/Vim
dual-licensed.)

This uses GetFileInformationByHandleEx() to detect mintty. This API is rather
new (introduced in Vista), so this patch requires VC2008 (or newer MinGW).
If VC2005 or earlier are used, the detection is disabled.

WinXP doesn't have GetFileInformationByHandleEx() natively, so the detection
doesn't work on XP, but the vim.exe can run on XP because dynamic loading is
used. (Actually, if "Win32 FileID API Library" is linked, the API can be used
also on XP, but the library is no more available from Microsoft website.)

What do you think?  Comments are welcome.

Regards,
Ken Takata

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui