6e6310d (filesystem: New specific variable MSYS2_PS1., 2016-05-01)
introduced the MSYS2_PS1 prompt script priority to allow multiple
device configurations.
Unfortunately, if MSYS2_PS1 was not set it overwrote the $PS1, even
when specifically set by the users configuration, such as provided in the
Git-for-Windows SDK (see https://github.com/git-for-windows/git/issues/794#issuecomment-227401839)
and the monkey patch fix (https://github.com/git-for-windows/build-extra/pull/122).
Introduce a priority order so that the user's $PS1 (if set) has an
intermediate priority between the MSYS2_PS1 and the default PS1.
Signed-off-by: Philip Oakley <philipoakley@iee.org>
* Avoid continuously appending items to MANPATH and INFOPATH when
sourcing /etc/profile multiple times.
* Check for .bashrc existence in shell manager.
Now users don't need to override installation prefix for MinGW programs and
'configure' scripts use more compatible triplet 'x86_64-w64-mingw32`
automatically instead of 'x86_64-pc-mingw64`.
* Improve shell manager to run existing executable files provided as
first argument, instead of opening them with Windows Explorer.
* Add simplified parameter -here to shell starter, making the directory
argument optional and deprecating the -where parameter.
* Add -help parameter to shell starter.
MSYSTEM now defaults to MSYS when not specified, and there is no
different behavior anymore between empty value and MSYS, for example
/opt/bin was not being added to path when not setting MSYSTEM. This
removes the need for explicitly setting the variable, since a default
value is now implied.
* Warning about required shortcut changes.
When upgrading the filesystem package, user will be notified about the
unified msys2_shell.cmd and asked for updating their shortcuts.
* New warning mechanism for interactive bash sessions.
Applications can now add warnings to the terminal for notifying the
user about possible problems. This is done by adding a file containing
the warning text to one of the following locations:
- /etc/profile.d/NAME.warning
- /mingw32/etc/profile.d/NAME.warning
- /mingw64/etc/profile.d/NAME.warning
These files are processed by /etc/bash.bashrc. Files with the
"warning.once" extension are removed after processing. An
implementation example is provided by next change.
* Add simplified parameter -full-path to msys2_shell.cmd. The old
parameter -use-full-path still works for now but is marked as
deprecated using the above warning mechanism.
* Add file opening support to shell manager.
Both directory and file arguments are now accepted and passed to
Windows Explorer for opening with default application.
* Residual pkgrel updates.
* Fix default value for MSYSTEM.
This was being determined based on relative paths to /mingw64 and
/mingw32. Since these directories are provided by filesystem, it
would always default to MINGW64, and only under such relative path
condition. MSYSTEM now defaults to MSYS when not specified.
* Remove the ambiguous parameters -mingw and -msys2.
For the same reason above, and for avoiding confusion since MINGW
shells are also "MSYS2 shells", respectively.
Setting this variable now makes /etc/bash.bashrc use that as PS1 instead
of default value. This allows for configuration shared between MSYS2 and
other environments like Cygwin or MinGW.org MSYS to define a PS1 that is
specific to MSYS2 without manual detection of the system type.
This script can now also be used for executing commands with custom
handling for better MSYS2 integration. The following commands are
currently supported and more can be added:
* Windows Explorer, for proper backslash path conversion.
* Windows command prompt, for properly executing under winpty.
* Programs under /mingw32 and /mingw64, for the same reason.
This more specific name improves MSYS2 detection by applications that
are sensitive to the presence of this file, such as the installer script
make-msys2-installer.bat.
These batch files used to contain duplicated code that has been merged
into start_shell.cmd. Shortcuts can replace them like this:
* Call `start_shell.cmd -mingw32` instead of mingw32_shell.bat.
* Call `start_shell.cmd -mingw64` instead of mingw64_shell.bat.
* Call `start_shell.cmd -msys` instead of msys2_shell.bat.
* New script /etc/msystem providing information associated with the
current MSYSTEM. This is sourced by /etc/profile but can be used by
non-login scripts for getting information such as the current
compiler architecture or mount point.
* New script /usr/bin/shell for switching between shells without
restarting MSYS2. This can be used in interactive sessions but also
from shell scripts for switching the MSYSTEM without restarting bash
or spawning a subshell.
* Allow /etc/profile to be sourced multiple times without continuously
appending stuff to PATH or losing track of the original Windows TEMP.
Also implemented for /etc/profile.d/perlbin.sh, so perl path is not
repeatedly appended.
* Introduce parameter '-where' which must be followed by an existing
directory which will be used to start the shell in (use . for the
current working directory)
* Use setlocal to return to the original directory after this script
finished (any calls to cd will be local to this script)
The generic variable SET_FULL_PATH has been replaced with MSYS2_PATH_TYPE, which
can accept the following values:
* strict: no Windows path.
* inherit: full Windows path.
* Other values: minimal Windows path (default).