File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -406,6 +406,9 @@ int mingw_raise(int sig);
406406int winansi_isatty (int fd );
407407#define isatty winansi_isatty
408408
409+ int winansi_dup2 (int oldfd , int newfd );
410+ #define dup2 winansi_dup2
411+
409412void winansi_init (void );
410413HANDLE winansi_get_osfhandle (int fd );
411414
Original file line number Diff line number Diff line change @@ -474,6 +474,18 @@ static void die_lasterr(const char *fmt, ...)
474474 va_end (params );
475475}
476476
477+ #undef dup2
478+ int winansi_dup2 (int oldfd , int newfd )
479+ {
480+ int ret = dup2 (oldfd , newfd );
481+
482+ if (!ret && newfd >= 0 && newfd <= 2 )
483+ fd_is_interactive [newfd ] = oldfd < 0 || oldfd > 2 ?
484+ 0 : fd_is_interactive [oldfd ];
485+
486+ return ret ;
487+ }
488+
477489static HANDLE duplicate_handle (HANDLE hnd )
478490{
479491 HANDLE hresult , hproc = GetCurrentProcess ();
You can’t perform that action at this time.
0 commit comments