how to change default settings in .minttyrc programmatically
Asked Answered
U

1

1

I want to increase the default font Lucida Console from 9pt to 12pt and adjust the blue color quality. Currently the only way I can find to do it is by right-clicking the Cygwin window and selecting Options & Text and Apply as described in this answer.

I tried to edit .minttyrc to change the font size and color as suggested here. Settings are shown below. But when I relaunch the Cygwin shortcut the default window reappears.

C:\cygwin64\home>cat .minttyrc
FontHeight=12
Blue=127,127,255
BoldBlue=191,191,255

Is there a way to set .minttyrc programmatically ? Surely there is a way to change the default settings without doing this manually every time.

EDIT.

I have Cygwin configured like this ( a screen shot of the window opened by the DOS batch file).

enter image description here

Here is the code suggested by me_and

C:\cygwin64\home\Greg\Work\CMI>cat ~/.minttyrc
cat: '~/.minttyrc': No such file or directory

I can get .bashrc to find .CMI_functions in a sub-directory but I don't know how to get it to find .minttyrc in the same directory

CONCLUSION.

Best results came from editing the Cygwin batch file to relocate all .executable bash files, together with .minttyrc, into C:\cygwin64\home\%USERNAME%.

cd    %USERPROFILE%\Desktop\Archive\UTIL
xcopy .            C:\cygwin64\home\%USERNAME%\Work\CMI\UTIL /E /I
copy  Misc\*       C:\cygwin64\home\%USERNAME%\Work\CMI
copy  Bash\.*      C:\cygwin64\home\%USERNAME%
copy  Scripts\*.sh C:\cygwin64\home\%USERNAME%\Work\CMI
Upturned answered 13/10, 2021 at 12:5 Comment(5)
Changing ~/.minttyrc should make the changes persistent, so there's clearly something odd going on for you. How, precisely, are you starting Cygwin? What happens if you run cat ~/.minttyrc from within a Mintty Cygwin Bash session?Apprehend
Thanks for your suggestion. See my edit. It hopefully sheds more light on the problem.Upturned
That's given me the information I needed to work out what was going on, but for reference you ran that cat command from within a Windows command shell, which can frequently get you very different results to running things from within Cygwin Bash. If you want to use Mintty and Cygwin Bash, you're normally best starting them using the icons that Cygwin's installers will put on your Desktop and/or in your Start Menu.Apprehend
Another thing that may be relevant is the text in the Target window of the Cygwin shortcut. C:\cygwin64\bin\mintty.exe /bin/sh -lc 'cd $HOME/Work/CMI; exec bash'Upturned
@Upturned : Did you have the mintty settings dialogue open at the time you updated .minttyrc? It could be that mintty updates the rc file when this dialogue is closed. If you can reproduce the faulty behaviour, I suggest that you open an issue on the mintty site. The maintainer is usually very responsive when it comes to bug reports. I can not reproduce it here.Stanfill
A
2

The Super User question you've linked to talks about putting the .minttyrc file as ~/.minttyrc, which as a Windows path (at least with default settings) would be something like C:\cygwin64\home\Greg\.minttyrc, but you have it as C:\cygwin64\home\.minttyrc. That's the wrong place, so it's never going to work.

To change the settings for Mintty, you need to have the file in the right location, otherwise it won't be able to load them. Try moving the file to the correct location, and see if that resolves things for you.

Apprehend answered 19/10, 2021 at 8:23 Comment(4)
That solved it. You're a gem!Upturned
I put .minttyrc into C:\cygwin64\home` because that's where .bashrc` .bash_profile .profile and others were. The confusion comes from $HOME which is in C:\Users\Greg (i.e. DOS) and C:\cygwin64\home\Greg (Cygwin)Upturned
Something has gone wrong there then, too; all those files for Cygwin should be in C:\cygwin64\home\Greg or equivalent. If you think there's a bug there, I'd recommend reporting it to the Cygwin mailing list; if at all possible, they'll want to have step-by-step instructions for what you did to get your dotfiles in that incorrect location.Apprehend
I might be wrong but I don't think there is a bug. See my edit.Upturned

© 2022 - 2024 — McMap. All rights reserved.