Cygwin: pty: Introduce disable_pcon in environment CYGWIN.

- For programs which does not work properly with pseudo console,
  disable_pcon in environment CYGWIN is introduced. If disable_pcon
  is set, pseudo console support is disabled.
This commit is contained in:
Takashi Yano 2020-01-21 22:25:13 +09:00 committed by Corinna Vinschen
parent da4ee7d60b
commit cdf5db22f1
4 changed files with 10 additions and 0 deletions

View File

@ -120,6 +120,7 @@ static struct parse_thing
{"reset_com", {&reset_com}, setbool, NULL, {{false}, {true}}}, {"reset_com", {&reset_com}, setbool, NULL, {{false}, {true}}},
{"wincmdln", {&wincmdln}, setbool, NULL, {{false}, {true}}}, {"wincmdln", {&wincmdln}, setbool, NULL, {{false}, {true}}},
{"winsymlinks", {func: set_winsymlinks}, isfunc, NULL, {{0}, {0}}}, {"winsymlinks", {func: set_winsymlinks}, isfunc, NULL, {{0}, {0}}},
{"disable_pcon", {&disable_pcon}, setbool, NULL, {{false}, {true}}},
{NULL, {0}, setdword, 0, {{0}, {0}}} {NULL, {0}, setdword, 0, {{0}, {0}}}
}; };

View File

@ -3145,6 +3145,8 @@ is_running_as_service (void)
bool bool
fhandler_pty_master::setup_pseudoconsole () fhandler_pty_master::setup_pseudoconsole ()
{ {
if (disable_pcon)
return false;
/* If the legacy console mode is enabled, pseudo console seems /* If the legacy console mode is enabled, pseudo console seems
not to work as expected. To determine console mode, registry not to work as expected. To determine console mode, registry
key ForceV2 in HKEY_CURRENT_USER\Console is checked. */ key ForceV2 in HKEY_CURRENT_USER\Console is checked. */

View File

@ -71,6 +71,7 @@ bool pipe_byte;
bool reset_com; bool reset_com;
bool wincmdln; bool wincmdln;
winsym_t allow_winsymlinks = WSYM_sysfile; winsym_t allow_winsymlinks = WSYM_sysfile;
bool disable_pcon;
bool NO_COPY in_forkee; bool NO_COPY in_forkee;

View File

@ -99,6 +99,12 @@ system call will immediately fail.</para>
<xref linkend="pathnames-symlinks"></xref>.</para> <xref linkend="pathnames-symlinks"></xref>.</para>
</listitem> </listitem>
<listitem>
<para><envar>disable_pcon</envar> - if set, pseudo console support in
pty will be disabled. This is for programs which do not work properly
under pty with pseudo console enabled. Defaults to not set.</para>
</listitem>
</itemizedlist> </itemizedlist>
</sect2> </sect2>