Skip to content

Commit

Permalink
installer: offer pseudo console support as an experimental option
Browse files Browse the repository at this point in the history
Cygwin runtime v3.1.x came with a really cool new feature: pseudo
console support. Theoretically, this allows users to run native console
programs in a MinTTY without having to use winpty. Practically, the
feature is unfortunately still too buggy to unleash onto the Git for
Windows user masses. But we can offer it as an experimental option so
that users can provide early feedback.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed May 19, 2020
1 parent ad9a867 commit b73b4e3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
29 changes: 28 additions & 1 deletion installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,17 @@ const
#define HAVE_EXPERIMENTAL_OPTIONS 1
#endif
#ifdef WITH_EXPERIMENTAL_PCON
#define HAVE_EXPERIMENTAL_OPTIONS 1
#endif
#ifdef HAVE_EXPERIMENTAL_OPTIONS
// Experimental options
GP_BuiltinDifftool = 1;
GP_BuiltinRebase = 2;
GP_BuiltinStash = 3;
GP_BuiltinAddI = 4;
GP_EnablePCon = 5;
#endif
var
Expand Down Expand Up @@ -440,7 +445,7 @@ var
#ifdef HAVE_EXPERIMENTAL_OPTIONS
// Wizard page and variables for the experimental options.
ExperimentalOptionsPage:TWizardPage;
RdbExperimentalOptions:array[GP_BuiltinDifftool..GP_BuiltinAddI] of TCheckBox;
RdbExperimentalOptions:array[GP_BuiltinDifftool..GP_EnablePCon] of TCheckBox;
#endif
// Mapping controls to hyperlinks
Expand Down Expand Up @@ -2091,6 +2096,14 @@ begin
RdbExperimentalOptions[GP_BuiltinAddI].Checked:=ReplayChoice('Enable Builtin Interactive Add','Auto')='Enabled';
#endif
#ifdef WITH_EXPERIMENTAL_PCON
// 5th option
RdbExperimentalOptions[GP_EnablePCon]:=CreateCheckBox(ExperimentalOptionsPage,'Enable experimental support for pseudo consoles.','<RED>(NEW!)</RED> This allows running native console programs like Node or Python in a'+#13+'Git Bash window without using winpty, but it still has known bugs.',TabOrder,Top,Left);
// Restore the settings chosen during a previous install
RdbExperimentalOptions[GP_EnablePCon].Checked:=ReplayChoice('Enable Pseudo Console Support','Auto')='Disabled';
#endif
#endif
PageIDBeforeInstall:=CurrentCustomPageID;
Expand Down Expand Up @@ -2769,6 +2782,12 @@ begin
GitSystemConfigSet('add.interactive.useBuiltin',#0);
#endif
#ifdef WITH_EXPERIMENTAL_PCON
if RdbExperimentalOptions[GP_EnablePCon].checked and
not SaveStringToFile(ExpandConstant('{app}\etc\git-bash.config'),'MSYS=enable_pcon',False) then
LogError('Could not write to '+ExpandConstant('{app}\etc\git-bash.config'));
#endif
{
Modify the environment
Expand Down Expand Up @@ -3112,6 +3131,14 @@ begin
RecordChoice(PreviousDataKey,'Enable Builtin Interactive Add',Data);
#endif
#ifdef WITH_EXPERIMENTAL_PCON
Data:='Disabled';
if RdbExperimentalOptions[GP_EnablePCon].Checked then begin
Data:='Enabled';
end;
RecordChoice(PreviousDataKey,'Enable Pseudo Console Support',Data);
#endif
Path:=ExpandConstant('{app}\etc\install-options.txt');
if not SaveStringToFile(Path,ChosenOptions,False) then
LogError('Could not write to '+Path);
Expand Down
5 changes: 5 additions & 0 deletions installer/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ then
inno_defines="$inno_defines$LF#define WITH_EXPERIMENTAL_BUILTIN_ADD_I 1"
fi

if grep -q enable_pcon /usr/bin/msys-2.0.dll
then
inno_defines="$inno_defines$LF#define WITH_EXPERIMENTAL_PCON 1"
fi

GITCONFIG_PATH="$(echo "$LIST" | grep "^$etc_gitconfig\$")"
test -z "$GITCONFIG_PATH" || {
keys="$(git config -f "/$GITCONFIG_PATH" -l --name-only)" &&
Expand Down

0 comments on commit b73b4e3

Please sign in to comment.