- If *.bat or *.cmd is executed directly from cygwin shell, pty
  failed to switch I/O pipe to that for native apps. This patch
  fixes the issue.
---
 winsup/cygwin/spawn.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 2f745e14a..7de96827c 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -227,7 +227,12 @@ is_console_app (WCHAR *filename)
   if (p && p + id_offset <= buf + n)
     return p[id_offset] == '\003'; /* 02: GUI, 03: console */
   else
-    return false;
+    {
+      wchar_t *e = wcsrchr (filename, L'.');
+      if (e && (wcscasecmp (e, L".bat") == 0 || wcscasecmp (e, L".cmd") == 0))
+       return true;
+    }
+  return false;
 }
 
 int
-- 
2.37.1

Reply via email to