Bug 312664 - add option to snap window size to integer characters
Summary: add option to snap window size to integer characters
Status: CONFIRMED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.9.5
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 453284 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-01-05 10:44 UTC by Alexander Kiselyov
Modified: 2023-01-28 07:05 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
An example of bad window size (20.91 KB, image/png)
2013-01-05 10:45 UTC, Alexander Kiselyov
Details
Profile settings for size snaping. (6.35 KB, patch)
2014-01-14 01:33 UTC, danharibo
Details
Naive implementation of window size snaping (1.85 KB, patch)
2014-01-14 01:34 UTC, danharibo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kiselyov 2013-01-05 10:44:21 UTC
Currently konsole window can be resized like any other. But it is inconvenient in e.g. Midnight Commander when a window hasn't got exactly N characters width/height.

For example, in Terminal from Xfce default behaviour is to resize only to integer number of characters.

Would be great if konsole had such an option.

Reproducible: Always

Steps to Reproduce:
1. Resize konsole window with mc started.

Actual Results:  
Annoying black "edges".

Expected Results:  
Option to snap to character size.
Comment 1 Alexander Kiselyov 2013-01-05 10:45:38 UTC
Created attachment 76201 [details]
An example of bad window size
Comment 2 Jekyll Wu 2013-01-06 13:39:09 UTC
Thanks for reporting. I agree the requested behavior is better .
Comment 3 danharibo 2014-01-14 01:33:30 UTC
Created attachment 84635 [details]
Profile settings for size snaping.
Comment 4 danharibo 2014-01-14 01:34:15 UTC
Created attachment 84636 [details]
Naive implementation of window size snaping
Comment 5 danharibo 2014-01-14 01:34:31 UTC
I took a shot at implementing this as a profile setting, split across two patches.

One for the settings and UI changes for the profile editor, and the other a naive approach that has a bit of a hack in order to get Qt to size the window correctly and TerminalDisplay to get the right number of rows and columns (I'm not familar enough with Konsole or Qt to know why it behaves the way it does, perhaps someone who knows a bit more about how Qt handles size increments might be able to shed some light on it).
Comment 6 Kurt Hindenburg 2014-01-29 14:38:49 UTC
Thanks for the patches - is there any reason to not just have this enabled and remove the GUI part?
Comment 7 forestbeasts 2022-03-14 04:05:32 UTC
This is still relevant in 2022, and would still be great to have! The patches don't apply as-is, but might be good after being rewritten to match the current code.

Having it as a setting might still be useful, in case someone would rather have the window exactly conforming to maximized screen size or window tiling zones. We don't personally need it, but I'm not sure whether other people would.

Should it be a profile setting (like the existing patch has), or a global setting? It'd make more sense as a global setting to me, I think.

-- Frost
Comment 8 ratijas 2022-03-14 17:27:25 UTC
> Should it be a profile setting (like the existing patch has), or a global setting?

Since one window may combine tabs with different profiles, and even splits within a tab, it would make more sense as a global setting. And I'm really not sure how should it behave with different fonts and sizes across those tabs and splits. Clearly they are not bound to always match each other.

What do other terminal implementations have to show for it? (fancy way of wondering how do they behave?)
Comment 9 forestbeasts 2022-03-31 02:04:25 UTC
gnome-terminal just doesn't have a setting for it, and always snaps. Huh, didn't think about different profiles in one window... /that/ complicates things.

gnome-terminal doesn't look like it even has splits. If we still used Mac, I'd look to see what Terminal.app and iTerm2 did, although I bet they only had one profile per window.

Would snapping to the grid of /any/ of the current fonts combined work (so e.g. if you have a 12px-tall font and a 15px-tall font it'd snap to both the 12px and the 15px grid "lines")? Although, no that doesn't really fit with the window manager side of things going on an increment. Maybe just the largest font in the window, or the smallest, using the current non-snapping alignment behavior for other-profile splits.

-- Frost
Comment 10 tnemeth 2023-01-28 07:05:08 UTC
*** Bug 453284 has been marked as a duplicate of this bug. ***