Closed jack6th closed 10 months ago
Cygwin works. The -Q
option checks terminal properties (screen and keyboard). If either fails, then it gives up. In this case the keyboard input isn't detected as a tty device or standard input is not a tty in vkey.cpp function setup
:
tty = open("/dev/tty", O_RDWR);
if (tty < 0)
{
if (isatty(STDIN_FILENO) == 0)
return false;
tty = STDIN_FILENO;
}
Could be something as simple as isatty()
failing.
Actually kind of strange that I have not trouble with ugrep running in Cygwin when in your case MinGW fails. Since Cygwin isatty()
is fine (as it is likely just calling Windows _isatty()
), why wouldn't MinGW not work too? I don't have MinGW installed to check for details. This has nothing to do with the ripgrep bug 117, which in ugrep works fine using isatty()
on standard output (instead of standard input in vkey.cpp) and combing some special code for Windows console checking.
What is your Windows OS version?
If your Windows OS version is 7 or even older, then we already know -Q will not work and this is not fixable, see #142 #84.
Thanks for your reply. My OS is Windows 7 SP1 32bit. I recompiled ugrep with MSYS2 32bit and now -Q works.
I compiled a win32 ugrep.exe using mingw32 gcc on Windows. (ugrep v4.3.1, i686-w64-mingw32, gcc v13.2.0) Without -Q it works. (eg. ugrep -e pattern filename.txt) On cmd.exe, conemu.exe and mintty.exe I tried command below all get the error message.
Is the issue like https://github.com/BurntSushi/ripgrep/issues/94 and https://github.com/BurntSushi/ripgrep/issues/117 ?