I updated git for windows and found that it now has mintty
as the command prompt for git bash. It is much better than previous windows command prompt based git bash.
It would be great if I could open the git bash initially maximized. There is a command line argument for mintty to open maximized.
-w, --window normal|min|max|full
But, I don't know how I can pass this argument to mintty when I open git bash from 'Open git bash here' context menu.
Does anyone know how to get this done?
Once you've finished installing it, you should be able to go to Start > All Programs > Cygwin > mintty to launch it.
Mintty is a terminal emulator for Cygwin with a native Windows user interface and minimalist design. Its terminal emulation is largely compatible with xterm, but it does not require an X server.
config/mintty folder is the XDG default base directory. The $APPDATA/mintty folder is especially useful to share common configuration for various installations of mintty (e.g. cygwin 32/64 Bit, MSYS, Git Bash).
You may put an minttyrc file into etc folder of Git install (like C:\Program Files\Git\etc), with the following config:
Window=max
If you change your mind and want to set a specific window size you can alternatively put the number of columns and rows into minttyrc, for example:
Columns=132
Rows=60
btw, based on https://github.com/mintty/mintty/blob/7d70b3cb9776de288375ffe438d35e648650c98f/wiki/Tips.md, we may have several locations:
For its configuration file, it reads /etc/minttyrc, $APPDATA/mintty/config, ~/.config/mintty/config, ~/.minttyrc, in this order.
This is kind of a hack, but I got it working by replacing git-bash.exe
with my own one which gives -w max
additional argument.
Here is the code for git-bash.exe
.
#include "stdafx.h"
#include <stdlib.h>
int _tmain(int argc, _TCHAR* argv[])
{
system("START /B D:\\program_files\\git\\Git\\usr\\bin\\mintty.exe -w max -o AppID=GitForWindows.Bash -o RelaunchCommand=\"D:\\program_files\\git\\Git\\git-bash.exe\" -o RelaunchDisplayName=\"Git Bash\" -i /mingw64/share/git/git-for-windows.ico /usr/bin/bash --login -i");
return 0;
}
You have to change paths in above code to your own values if you need to build your own git-bash.exe
from above code.
EDIT:
If mintty is started with above code, it does not know the location of git
binary. So I had to add the git bin directory to PATH variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With