* Remove double quotes of the LOGINSHELL
When set shell arguments, LOGINSHELL has double quotes.
In the default, L6: set "LOGINSHELL=bash".
I followed the format it.
* Add value to $SHELL for zsh
Issue:
1. Run, C:\msys64\msys2_shell.cmd -mingw64 -shell zsh
2. echo $SHELL
3. Nothing
* Fix msys2_shell.cmd argument-handling with spaces
Commit 11ba641bed intended to preserve [`cmd.exe` delimiter characters](https://ss64.com/nt/syntax-esc.html#delimiters) in the command line passed on to `bash`, but broke the handling of `-where` directories with spaces in them. Fix this by:
- Incrementing `shiftCounter` with any quoted arguments treated as separate words, because the `FOR /F ... IN`-loop at the end cannot treat them (in the full command) as single parameters.
- Using the full list of `cmd.exe` delimiters in the `FOR /F ... IN`-loop when skipping the initial tokens.
Tested this with:
```
C:\msys2\msys2_shell.cmd -defterm -no-start -mingw64 -where <DIR> -shell bash -c $@ -- echo hello there, --world=windows
```
where `<DIR>` is the following:
- C:\Users
- C:\Progra~1
- "C:\Program Files"
- "C:\Program Files (x86)"
- "C:\Users\T-17\Documents\Projects and Learning\test,dir"
Fixes#1826
* Clean up `FOR /F ... IN`-command
* Clean up working variables
* Adhere to lowercase CALL convention
* Prefix working variables with `msys2_` to prevent collisions with user-defined variables
* Don't clobber quotes and parentheses in final Bash command line
* Prevent warning trace on no arguments
* Handle cmd.exe metacharacters (e.g. parentheses) in Bash command line
Consider this inline invocation in a Windows Command Prompt:
```
C:\msys2\msys2_shell.cmd -defterm -no-start -mingw64 -here -c $@ -- echo hello there, --world=windows
```
This currently produces:
>hello there, --world windows
Note the absence of the `=` character. This is due to the word-splitting done by `cmd.exe` to form the positional parameters (`%1` - `%9`). The same word-splitting is not done on the `%*` special variable, so derive the remaining command line arguments.
With this fix, the above command produces:
>hello there, --world=windows
* 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.
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.