Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor interaction with taskbar, Windows 7-10 #495

Closed
martinjos opened this issue Nov 16, 2015 · 5 comments
Closed

Poor interaction with taskbar, Windows 7-10 #495

martinjos opened this issue Nov 16, 2015 · 5 comments

Comments

@martinjos
Copy link

I am aware that issue #54 has been closed (setting environment variables on the command line).

However, I have been trying to get MinTTY to interact better with the taskbar under Windows 10 (and probably 7/8), with MSYS2. With the current ".bat" file solution, the taskbar does not seem to properly associate the running instance with its shortcut.

Now, I am also aware that the ".bat" file can be eliminated if you create a shortcut with the following properties:

  • Target: C:\msys32\usr\bin\mintty.exe -i /msys2.ico /usr/bin/bash -c 'MSYSTEM=MSYS MSYSCON=mintty.exe /usr/bin/bash --login'
  • Start in: C:\msys2\usr\bin

However, for some reason, the instance and the shortcut still aren't matched up (perhaps it spawns another instance of mintty?). This causes a couple of things not to work:

  • If you right-click on the taskbar entry and click the top entry (in this case, "Terminal"), it is supposed to create a new instance - however, it seems to just start the binary without any arguments, resulting in failure.
  • If you pin the shortcut to the taskbar, you can create new instances, but they will have a taskbar entry that is separate from the shortcut.

In the process of trying to solve this, I implemented a very simple -E option for setting environment variables (see master...martinjos:environment-arg). It is fairly rudimentary - it simply calls setenv() during arg processing, and therefore is not able to override the variables set by mintty before spawning the child process - but it is enough for my purposes.

Well, I'm not sure why, but this completely solves the problem. Perhaps setting MSYSTEM and MSYSCON ensures that mintty does not need to spawn another instance of itself.

@martinjos martinjos changed the title Does not interact well with taskbar Poor interaction with taskbar, Windows 7-10 Nov 16, 2015
@mintty
Copy link
Owner

mintty commented Nov 16, 2015

Is this with the latest release (2.2.2)?

@martinjos
Copy link
Author

Ah, I've just realised that the problem doesn't exist in the Git mainline version. It is only in the release version. (They both report version 2.2.2.) I can solve the problem simply by going from the release to the mainline (and using the bash -c method as above). So the patch isn't necessary. My bad.

@mintty
Copy link
Owner

mintty commented Nov 16, 2015

Thanks for feedback; I wasn't sure anyway how setting those variables should be affecting taskbar behaviour. On the other hand, I'm not sure what Git mainline version is. The mintty packaged with Git for Windows, or the current master download from github? In either case, the symptoms are still mysterious with 2.2.2.

@martinjos
Copy link
Author

"Git mainline" is the current master from Github, and doesn't have the symptoms. The current 32-bit release version from http://msys2.github.io/ does have the symptoms.

@mintty
Copy link
Owner

mintty commented Nov 10, 2018

Released 2.9.4 with improved taskbar icon grouping behaviour and configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants