Nessesarius / mintty

Automatically exported from code.google.com/p/mintty
GNU General Public License v3.0
0 stars 0 forks source link

Resize font and window together #233

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It might be useful to provide a way to resize font and window together, such 
that the number of rows and columns stays approximately constant. (It can only 
be approximate because font sizes are not as flexible as window sizes.)

This should apply both to font resizes with Ctrl+plus/minus or Ctrl+mousewheel, 
and to window resizes e.g. by dragging the window edges or switching between 
normal/maximised/fullscreen states.

PuTTY has a config dialog option for this (along with generally somewhat flaky 
resize handling). I think it would be better though to be able to activate this 
behaviour only when needed. Holding Shift while performing one of the relevant 
actions seems an appropriate way to do this, so for example pressing 
Shift+Alt+F11 would zoom to fullscreen.

See also issue 79 for ideas on how to handle the problem of the window going 
off screen when increasing font size. Issue 204 was about the fullscreen aspect 
of this only.

Without this enhancement, users simply have to resize font and window 
separately.

Original issue reported on code.google.com by andy.koppe on 6 Nov 2010 at 6:59

GoogleCodeExporter commented 8 years ago
The old rxvt currently re-sizes font and window together but in major jumps 
that scales with each font size change via Ctrl+plus/minus.

So as a great replacement for rxvt, it would be awesome to see mintty with 
similar (or better) capabilities.

Thanks!

Original comment by duhgl...@gmail.com on 28 Apr 2011 at 4:17

GoogleCodeExporter commented 8 years ago
Hmm, I don't see that feature in rxvt. Does one need to do anything special to 
enable it?

Original comment by andy.koppe on 28 Apr 2011 at 11:15

GoogleCodeExporter commented 8 years ago
I mis-spoke. The resizing simply cycles through font, font1, ..., font4 via
SHIFT+Keypad Plus/Minus.
And no, the feature is enabled by default.

From the rxvt man page:
CHANGING FONTS You can change fonts on-the-fly, which is to say cycle
through the default font and others of various sizes, by using *Shift-KP_Add
* and *Shift-KP_Subtract*. Or, alternatively (if enabled) with *Alt->* and *
Alt-<*, where the actual key can be selected using resources *smallfont_key*
/*bigfont_key*.

HTH,
Doug

PS - Thanks for the quick response.

Original comment by duhgl...@gmail.com on 28 Apr 2011 at 2:44

GoogleCodeExporter commented 8 years ago
According to http://code.google.com/p/mintty/wiki/Changes, "0.9.4 (18 Dec 2010) 
... Stopped resizing the window when changing font size with 
Ctrl+plus/minus/zero or Ctrl+mousewheel.This follows the example of KDE's 
Konsole and is more consistent with other programs that have this feature.".  
If I understand this correctly, the old behavior is much preferable.  It's just 
about the only thing I prefer in rxvt.  I don't use Konsole, I use xterm, and 
it doesn't behave this way.  Perhaps just wrapping this change in an option 
would be an easy way to satisfy issue 233.

Original comment by mhsolomo...@gmail.com on 3 Jul 2011 at 12:06

GoogleCodeExporter commented 8 years ago
I would really like to see this - this is how mintty worked before revision 
r1073 (mintty 0.9.3), and I have actually been using a custom compiled version 
of mintty for three years now to retain this functionality.  I'd like to take 
advantage of the updates, but I can't do my work without this feature.  Maybe 
it's been added in the interim and there's some way for me to turn it on that 
I'm unaware of.

Original comment by jdavidb2...@gmail.com on 6 May 2014 at 1:44

GoogleCodeExporter commented 8 years ago
As a workaround, I just learned that I can hit Alt-F10 after changing the font 
size - this will change the number of rows and columns to my default.  What I 
really want is for this to happen automatically any time I change the font 
size, or at least for that behavior to be an option.  That might point the way 
toward implementing this, if I ever find time to dig into the code and become 
educated enough to try.  In the meantime, I'll probably get in the habit of 
hitting Alt-F10 automatically after a terminal resize.

Original comment by jdavidb2...@gmail.com on 7 May 2014 at 6:44

GoogleCodeExporter commented 8 years ago
Oops - that's still not quite right, because when I change the font my terminal 
isn't always at the default size.  It is for probably 90% of cases, though.

Original comment by jdavidb2...@gmail.com on 7 May 2014 at 6:54

GoogleCodeExporter commented 8 years ago
The previous behavior can be restored by adding a line in winmain.c .  I don't 
yet know how to make it an optional feature, but making this change will set it 
up so that all of your mintty terminals grow or shrink as you change the font 
size, retaining the same number of rows and columns.

In winmain.c,
in the win_adapt_term_size() function,
line 297 (in 1.1.3)
add:
  win_set_chars(term.rows, term.cols);
immediately after the if(IsIconic(wnd)) return; statement.

Original comment by jdavidb2...@gmail.com on 8 May 2014 at 4:08

GoogleCodeExporter commented 8 years ago
Oops, that breaks fullscreen mode! :D

Original comment by jdavidb2...@gmail.com on 8 May 2014 at 8:07

GoogleCodeExporter commented 8 years ago
So, to fix fullscreen, change the above patch suggestion to:

if (!win_is_fullscreen)
 win_set_chars(term.rows, term.cols);

Original comment by jdavidb2...@gmail.com on 12 May 2014 at 5:48

GoogleCodeExporter commented 8 years ago
Still not quite right - raise the font size a couple times, then maximize with 
alt-enter, then alt-enter again and it should shrink back to 80x24 (or whatever 
the previous size was) but does not.  I'll keep picking at it till I get it 
right. :)

Original comment by jdavidb2...@gmail.com on 12 May 2014 at 6:33

GoogleCodeExporter commented 8 years ago
Also, now if I click and drag to resize the window, it resets back to the 
previous size.  So I'm stuck at 80x24.

Original comment by jdavidb2...@gmail.com on 22 May 2014 at 2:35

GoogleCodeExporter commented 8 years ago
See https://github.com/mintty/mintty/issues/233

Original comment by towom...@googlemail.com on 21 Jul 2015 at 11:21

GoogleCodeExporter commented 8 years ago
THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Original comment by jdavidb2...@gmail.com on 21 Jul 2015 at 1:40

GoogleCodeExporter commented 8 years ago
I hate to say it, but I just pulled the latest code and built it, and this
doesn't seem to work for me.  When I hit shift, control, and Plus on the
keypad, I get "6k" in the mintty window.  I tried the left and the right
control and shift keys.  I'm running on Windows 7 with the latest Cygwin
from setup.exe .  I launched mintty from the command-line in my build
directory

On Tue, Jul 21, 2015 at 8:40 AM, David Blackstone <jdavidb2006@gmail.com>
wrote:

Original comment by jdavidb2...@gmail.com on 21 Jul 2015 at 2:12

GoogleCodeExporter commented 8 years ago
For my setup, essentially default, Shift + Ctrl + Numpad '+' maps to every 6th 
entry in my history. 
However Shift + Ctrl + Numpad '-' does nothing.

But Ctrl + Numpad '+' / '-' / '0' still do what they need which is good enough 
to keep me going.

Thanks if I haven't said it before...

Original comment by duhgl...@gmail.com on 22 Jul 2015 at 1:39