Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change default XTerm font size in Cygwin

Anyone know how to change the default font size when you open a new XTERM windown in Cygwin?

I have found references of putting information into the ~/.Xresources file but that file doesn't exist for me...

Thanks

like image 533
darrenc Avatar asked Oct 18 '11 17:10

darrenc


People also ask

How do I change the default font size in xterm?

If you want to change the font size, hold down the Control key and the right hand mouse button within the xterm window. This will display the VT font menu and you can select the font size you want.

How do I change the size of xterm windows?

It's possible to change the xterm font size by holding ctrl and right-clicking the window.

What is the default xterm font?

Table 5-1 shows the correspondence between these aliases and full font names. Note that the 6×13 font also has an alias called “fixed” defined for it. The “fixed” alias is used as the default font for xterm windows.

How do I change the default font size in MobaXterm?

Save this question. Show activity on this post. I was excited to learn that you can hold down Ctrl and use the scroll wheel on the mouse to change the font size in MobaXterm.


3 Answers

Around ~2015 XWin Server was overhauled and you no longer need to create .startxwinrc because it no longer exists. I found that the ~/.Xresources is read in automatically. Also I found that XTerm.vt100.geometry is not valid anymore.

This is my .Xresources:

Xft*antialias:      true
Xft*autohint:       true
XTerm*background:   white  <== These settings mimics 
XTerm*foreground:   black      the default back, fore
XTerm*cursorColor:  grey       and cursor colors
XTerm*scrollBar:    true
XTerm*rightScrollBar:   false  <== This causes the scroll bar to be 
                                   on the default left side
XTerm*saveLines:    10000
XTerm*faceName:     BitStream Vera Sans Mono
XTerm*faceSize:     12
XTerm*toolBar:      On <== This causes the menu bar to appear with 
                           Main Options, VT Options, and VT Fonts
like image 106
user3416126 Avatar answered Sep 19 '22 01:09

user3416126


here is how I fixed it:

  1. Make sure your are in your home directory, so "cd" and "pwd" to see that you are there
  2. Create the .Xresources file, just like "touch .Xresources"
  3. Edit it with your favourite editor ;)
  4. Here is my set up, it is actually very useful, it includes a side bar, and removes the top bar:

    Xft*antialias:          true
    Xft*autohint:           true
    XTerm*background:   black
    XTerm*foreground:   grey
    XTerm*cursorColor:  grey
    XTerm.vt100.geometry:   79x25
    XTerm*scrollBar:    true
    XTerm*rightScrollBar:   true
    XTerm*saveLines:    10000
    XTerm*faceName:     BitStream Vera Sans Mono
    XTerm*faceSize:     12
    XTerm*toolBar:      off
    
  5. You can test this changes with "xrdb -merge .Xresources" and then opening another xterm

  6. In order to save this changes you are going to have to create or modify another file, "touch .startxwinrc", open up your editor and include the following:

    #!/bin/sh
    
    xrdb -merge ~/.Xresources
    
  7. Restart your XWin Server, and you will have a prettier cygwin terminal.

like image 27
Gonzalo Avatar answered Oct 21 '22 14:10

Gonzalo


Gonzalo you made my day with your fix. The font size can also be dynamically changed with the following keyboard shortcuts:

  • Shift+NumPadPlus = Increase font size
  • Shift+NumPadMinus = Decrease font size

Please take in account that the new font size is active for the current xterm window and that it is active for the current process session only. A new process will start with XTerm*faceSize sized fonts.

like image 5
Gull_Code Avatar answered Oct 21 '22 14:10

Gull_Code