A new MSYS2 launcher

307 views
Skip to first unread message

David Macek

unread,
Nov 6, 2015, 8:50:35 AM11/6/15
to msys2...@lists.sourceforge.net, git-for...@googlegroups.com
Hi everyone.

I created a new launcher for MSYS2 and I'd like some feedback from you, MSYS2 users and developers. The launcher is called `msys2-launcher` and is now available in the repositories, but it's not yet part of the MSYS2 core distribution. The launcher only supports mintty at the moment, because it depends on its AppUserModel manipulation features.

The repository is at <https://github.com/elieux/msys2-launcher> and the PKGBUILD at <https://github.com/Alexpux/MSYS2-packages/tree/master/msys2-launcher-git/PKGBUILD>.

I'm also crossposting to the Git for Windows group, because GfW has its own launcher and if possible, I'd like to get some feedback from Johannes and others.


Why to use
==========
+ sets correct environment
+ allows customization of environment via a configuration file
+ doesn't show any temporary black window when starting
+ can be pinned correctly
+ allows running arbitrary command instead of just starting the shell


How to use
==========

1. Install with `pacman -Sy msys2-launcher`.
2. Start `msys2.exe`, `mingw64.exe`, or `mingw32.exe`, depending on your needs.
3. Pin the running process to your taskbar, if you want.

Don't pin the .exe file directly, because that just doesn't do the right thing (just ask Mozilla :).

You can also run `msys2.exe pacman -Syu` for example. It will open a window just for the one command.


What to tell me
===============
- if something doesn't work.
- if you have an idea how to make it better.
- whether you would like to use it as your main launcher (or why not?).
- whether you would still use the .bat files if this was your main launcher (and why?).


Cheers.

--
David Macek

David Macek

unread,
Nov 7, 2015, 12:11:48 PM11/7/15
to Ray Donnelly, Msys2, git-for...@googlegroups.com
On 7. 11. 2015 9:00, Ray Donnelly wrote:
> I like it, the pinning works great.
> The icons for the 64-bit vs 32-bit could maybe do with a bit of work
> (I'd make the 32-bit one less bright or more washed out than the
> 64-bit one maybe and try to incorporate the number more subtly).
> I the we should still provide the batch files for two reasons:
> 1. not to break existing use cases

Sounds reasonable.

> and 2. so the differences between the shells are made explicit rather
> than hidden away in the C code?

The difference should be obvious from the .ini files. (In earlier revisions, MSYSTEM values were embedded in the executable during compilation, but I changed it when I introduced the .ini files.)

> I'm up for making it part of the core installation once the mingw32
> and mingw64 icons are made a bit more pretty.

Cool.

--
David Macek

Johannes Schindelin

unread,
Nov 17, 2015, 9:13:22 AM11/17/15
to David Macek, msys2...@lists.sourceforge.net, git-for...@googlegroups.com
Hi David,

On Fri, 6 Nov 2015, David Macek wrote:

> I created a new launcher for MSYS2 and I'd like some feedback from you,
> MSYS2 users and developers. The launcher is called `msys2-launcher` and
> is now available in the repositories, but it's not yet part of the MSYS2
> core distribution. The launcher only supports mintty at the moment,
> because it depends on its AppUserModel manipulation features.

Excellent work! I agree with your rationales to replace the .bat with the
.exe (after all, I faced a lot of backlash for converting Git for Windows'
main entry point from a batch file into an executable myself, but I have
not heard of *any* good argument to keep the .bat file, what with its
serious shortcomings).

I am notoriously short on time these days, so I only had a quick glance at
the source code.

The only questions I have right now are:

- how about extending the .ini so it can call a specific command if none
was specified on the command-line?

- would it not make sense to adjust the `PATH` in the launcher, given that
calling `msys2-launcher blub.exe` skips the entire /etc/profile
including adjusting the `PATH`?

It would be nice if I could get rid of my custom
`git-bash.exe`/`git-cmd.exe` and replace it with an appropriately
configured msys2-launcher; for that to work, I would still need to figure
out a way how to turn this into `git-cmd.exe` (which is a *console*
program that only adjusts the environment variables but then calls
`cmd.exe` instead of `mintty.exe`/`bash.exe`).

Ciao,
Dscho

David Macek

unread,
Nov 17, 2015, 4:22:40 PM11/17/15
to Johannes....@gmx.de, msys2...@lists.sourceforge.net, git-for...@googlegroups.com
On 17. 11. 2015 15:13, Johannes Schindelin wrote:
> Hi David,
>
> On Fri, 6 Nov 2015, David Macek wrote:
>
>> I created a new launcher for MSYS2 and I'd like some feedback from you,
>> MSYS2 users and developers. The launcher is called `msys2-launcher` and
>> is now available in the repositories, but it's not yet part of the MSYS2
>> core distribution. The launcher only supports mintty at the moment,
>> because it depends on its AppUserModel manipulation features.
>
> Excellent work! I agree with your rationales to replace the .bat with the
> .exe (after all, I faced a lot of backlash for converting Git for Windows'
> main entry point from a batch file into an executable myself, but I have
> not heard of *any* good argument to keep the .bat file, what with its
> serious shortcomings).
>
> I am notoriously short on time these days, so I only had a quick glance at
> the source code.
>
> The only questions I have right now are:
>
> - how about extending the .ini so it can call a specific command if none
> was specified on the command-line?

Sounds doable. How 'bout this one? https://github.com/elieux/msys2-launcher/tree/ini-command

The command is specified as `=command=something`.

> - would it not make sense to adjust the `PATH` in the launcher, given that
> calling `msys2-launcher blub.exe` skips the entire /etc/profile
> including adjusting the `PATH`?

There's no skipping, I took great care to ensure that the profile is sourced in both use cases.

> It would be nice if I could get rid of my custom
> `git-bash.exe`/`git-cmd.exe` and replace it with an appropriately
> configured msys2-launcher; for that to work, I would still need to figure
> out a way how to turn this into `git-cmd.exe` (which is a *console*
> program that only adjusts the environment variables but then calls
> `cmd.exe` instead of `mintty.exe`/`bash.exe`).

I'd be happy to augment my launcher to be able to serve Git for Windows. Can you write down all the use cases that the launcher would need to cover?

--
David Macek

David Macek

unread,
Nov 20, 2015, 11:03:01 AM11/20/15
to Sandro Cumerlato, msys2...@lists.sourceforge.net, git-for...@googlegroups.com
On 20. 11. 2015 16:43, Sandro Cumerlato wrote:
> Really good job David!
>
> Is it possible to store/restore window position too?
>
> Thank you in advance for your reply.
>
> Sandro Cumerlato

Hi, Sandro.

Don't forget to use Reply all.

I think I'll leave the window positioning to mintty. For information about that, see <https://github.com/mintty/mintty/issues/273> or <https://code.google.com/p/mintty/issues/detail?id=273>.

I may later implement an option to pass custom arguments to mintty, if someone presents a good case for it, but that still won't be usable for remembering the position/size.

--
David Macek

Reply all
Reply to author
Forward
0 new messages