Cygwin: pty: Treat *.bat and *.cmd as a non-cygwin console app.
- 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.
This commit is contained in:
parent
8d564b62b7
commit
d5229f8211
|
@ -26,3 +26,8 @@ Bug Fixes
|
||||||
- Fix a console problem that the text longer than 1024 bytes cannot
|
- Fix a console problem that the text longer than 1024 bytes cannot
|
||||||
be pasted correctly.
|
be pasted correctly.
|
||||||
Addresses: https://cygwin.com/pipermail/cygwin/2022-June/251764.html
|
Addresses: https://cygwin.com/pipermail/cygwin/2022-June/251764.html
|
||||||
|
|
||||||
|
- Fix a pty problem that pty failed to switch I/O pipe to that for
|
||||||
|
native apps if *.bat or *.cmd is executed directly from cygwin
|
||||||
|
shell.
|
||||||
|
Addresses: https://cygwin.com/pipermail/cygwin/2022-July/251993.html
|
||||||
|
|
|
@ -227,7 +227,12 @@ is_console_app (WCHAR *filename)
|
||||||
if (p && p + id_offset <= buf + n)
|
if (p && p + id_offset <= buf + n)
|
||||||
return p[id_offset] == '\003'; /* 02: GUI, 03: console */
|
return p[id_offset] == '\003'; /* 02: GUI, 03: console */
|
||||||
else
|
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
|
int
|
||||||
|
|
Loading…
Reference in New Issue