How do you configure Msys's default size, color, and font?
Asked Answered
K

4

17

I've been exploring use of MSys lately as an alternative, 'nix-like shell for my windows development. However, the default colors and size are driving me crazy. Anyone have any idea as to how I can change the default size, color, and / or font? Honestly, I'd be happy if I could make the default character width/height of the shell larger, but the others would be nice too...

Clarification: the msys shell is a separate app from the windows shell - the normal 'right-click-upper-left -> properties' configuration (like with the windows shell) is not present.

Looks like underneath it's firing off rxvt. Thanks!

Keen answered 15/1, 2009 at 18:4 Comment(2)
Are you running the shell in an xterm or rxvt window?Numbing
Turns out it was rxvt. Now we're good.Keen
N
15

If you're running MSYS bash from a command line, Behind the scenes it's a windows command shell window, so configuring it is just the same.

  • Right click on the title bar at the top of the shell window and select 'properties'

  • Configure the window with the options on the tabs on the dialog; these should be fairly self-explanatory.

  • When you close the dialog, select 'Modify shortcut that started this window' to save the configuration back as defaults.

EDIT: If you're running the shell in an xterm or RXVT window through an X server, start the xterm window with -fg (foreground), -bg (background) and -fn (font). Can't remember what the RXVT switches are, but you should be able to see them in the man page. You can also configure them through your .Xdefaults file. Again, see the man page for details.

EDIT: Thanks Paulo - note that MSYS also comes with an X-less version of RXVT, which the OP seems to be using. Here's a link for configuring RXVT on MSYS.

Numbing answered 15/1, 2009 at 18:9 Comment(3)
Unfortunately, msys's shell does not use the windows shell - those properties are not available.Keen
msys starts the local rxvt (no X at all) and it is not a windows command console.Abney
Right clicking a shortcut to msys and modifying it's properties doesn't work, modifying the properties of the launched window will as the answer says.Skaw
A
8

Open the msys.bat file an aroun line 72 it reads like this:

rem Setup the default colors for rxvt.
if "x%MSYSBGCOLOR%" == "x" set MSYSBGCOLOR=White
if "x%MSYSFGCOLOR%" == "x" set MSYSFGCOLOR=Black
if "x%MINGW32BGCOLOR%" == "x" set MINGW32BGCOLOR=LightYellow
if "x%MINGW32FGCOLOR%" == "x" set MINGW32FGCOLOR=Navy
if "%MSYSTEM%" == "MSYS" set BGCOLOR=%MSYSBGCOLOR%
if "%MSYSTEM%" == "MSYS" set FGCOLOR=%MSYSFGCOLOR%
if "%MSYSTEM%" == "MINGW32" set BGCOLOR=%MINGW32BGCOLOR%
if "%MSYSTEM%" == "MINGW32" set FGCOLOR=%MINGW32FGCOLOR%

change the first 4 lines with the colors you like, to change the font, just bellow:

start %WD%rxvt -backspacekey  -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn Courier-12 -tn msys -geometry 80x25 -e /bin/sh --login -i

change the Courier-12 with your favourite font and the 80x25 with your prefered window size.

Abney answered 15/1, 2009 at 18:27 Comment(3)
A full article on the customisation of the console. article.gmane.org/gmane.comp.gnu.mingw.msys/3930Broeder
I have a port of X's misc-fixed 7x14 font optimized to work when selected in msys this way: samiam.org/blog/20131215.html This article also explains one way how to make a fontGerdagerdeen
Modifying these lines was my first guess, but looks useless when running msys on the classical win32 cli terminal. Looks like there are only two fonts to choose, no mather what. I don't think there's a remote possibility of modding with the win32 cli. Looks like it's only possible for rxvt and others.Loehr
P
2

I create HOME env var, which have value like 'e:\home' and put into %HOME% dir .Xdefaults file with such content:

Rxvt*background: white
Rxvt*foreground: black
Rxvt*geometry: 120x40
Rxvt*font: 7x14
Rxvt*scrollBar: on
Rxvt*saveLines: 5000

Also note that this config successfully work on Cygwin and various Unix boxes.

Precise answered 14/3, 2010 at 22:14 Comment(0)
D
1

If you're tired of using cmd for msys git, I recommend using minty and/or ConEmu : mintty to use mintty, download latest version from google code/mintty and drop it in the bin folder of git msys + make following shortcut:

"C:\Program Files (x86)\Git\bin\mintty.exe" --title "Git Bash" -w full --exec "C:\Program Files (x86)\Git\bin\sh.exe" --login -i

(set working dir to your home dir)

to use vim, make sure to read this bug report for colors, make sure gitconfig is set to color = always I set sublime as my default editor as vim didn't work, see notes below

note:

  • vim packaged with msys expects cmd terminal and won't work with mintty
  • interaction to enter username/password for git pushes using basic http auth won't work unless you host mitty in ConEmu. (ssh works fine on mitty by itself)

ref:

Dibrin answered 14/6, 2015 at 23:56 Comment(1)
mintty has now been integrated with git bash for the new git-for-windows.github.ioDibrin

© 2022 - 2024 — McMap. All rights reserved.