How to modify zoom level of gnome-terminal programatically? - gnome-terminal

One can modify the zoom level in the gnome-terminal by pressing C-+/-. I would like to modify the zoom level automatically in response to window size change (number of columns). Alternatively, are there terminals which support that? I am using a tiling window manager and would like to have the font adjust to the size of the window so that there is roughly constant number of characters in a line.

Related

vim x/y scrollbar hiding my commands and being really anoying

i'm a new vim user since 2 weeks and i've currently have my biggest trouble for the moment on vim.
i always have a x and y scrollbar on my vim and the x one is very anoying because it cover my commands.
here is a screenshot of the scrollbars that appears when i use terminal inside of vim using `:term` / `:!dir` or even when i save my vimrc or source it (`:so ~/.vimrc`)
if there is any solutions to it i will be really grateful, thanks for reading
This is an issue with your layout settings in Powershell and Ubuntu. Right click on the top bar of either program, go to Properties and then go to the Layout tab. You can check the Wrap text output on resize box and that should get rid of your horizontal scrollbar, thereby allowing you to use Vim as normal. Alternatively, in the same menu, you can decrease the width of the screen buffer size so that it is smaller than the width of the window size.

How to snap a window to top/bottom half of screen

One of my favorite features in Windows is the ability to snap windows. [1]
With Windows 10 they can now be snapped to quarter-screen, as well as the left- and right-half screen available in previous Windows releases.
Is it possible to snap a window to top and bottom half?
In other words, snap a window to span the width of the monitor, but only half the height? It could be snapped to either the top or bottom of the screen.
https://support.microsoft.com/en-us/help/4027324/windows-10-snap-your-windows
Unfortunately no, not natively. See e.g.: https://answers.microsoft.com/en-us/windows/forum/windows_10-desktop-winpc/snap-assist-to-top-and-bottom-in-portrait-mode/3ecdd25e-8886-4ef1-a7db-0d2e168ce381.
There are third-party solutions, such as https://www.displayfusion.com/Discussions/View/portrait-mode-and-windows-snapping/?ID=8e0ff0b8-5988-43d9-bd54-4567d7869f48 and https://www.nurgo-software.com/products/aquasnap
This is now natively supported in Windows 11. Press Windows+Z, then you can select where you want your window to be. There are several other portrait-only layouts too (the spot that is dark blue is the one my mouse is hovering over):
Not in the way that you snap windows to the left and right; if you try to snap a window to the top by dragging it to the top of your screen it will just maximize that window...and dragging to the bottom won't work at all.
One way that I can think of that will work is minimize 2 windows that you want to split and resize them both so that they span the width of the screen and approximately half the height of the screen. Then drag each window to the desired portion of the screen. To make things easier, you might want to have the window that you want on the bottom of the screen open over the one that you want on top of the screen before you start minimizing windows.

Missing pixels from upper left of window placed at origin

I have an application that uses a non-decorated window (no title bar and so on, it's eventually intended to be a full-screen application). It also has one-pixel-wide line images around the outside to form a natural border with the outside world.
When I run this application and the Window gets its default position (i.e., not at the (0,0) origin), the borders are clearly visible.
However, when I perform a this.Move(0, 0) in the constructor of the main window to make sure the window is positioned correctly, the upper-right pixels seem to disappear thus:
Ignore the Act text in that capture, it's actually the Activities menu under Gnome desktop. The actual upper-left pixel of the window is where those two red lines would meet.
Does anyone know what could be causing this issue? Is it possibly something to do with the Gnome Shell extensions taking control of that area?
The missing pixels are an artifact of the way gnome-shell does rounded rectangles for its windows.
If you really want to change it, you can edit the file /usr/share/gnome-shell/theme/gnome-shell.css. Look for the CSS selector .panel-corner and set -panel-corner-radius to 0px. This will cause the windows to have square corners rather than rounded ones. You will probably need to restart gnome-shell after making the change by pressing Alt-F2 and enter the r command.
Whether that edit will survive a gnome-shell (or even a theme) update is unsure, you may have to put into place something that keeps it at the value you want (or install an extension to do that for you).
That is how gnome-shell renders the top corners of the main monitor, it's a rounded corner, just not very visible with black on black. Changing this rendering is not something an application should do.
If your application is supposed to be full screen instead of just positioned at the corner, you could request gnome-shell to do that with Window.fullscreen(). Do not rely on always being full screen though: the window manager can decide otherwise.

SecureCRT: vim not using maximum terminal window size

No matter what the size of the SecureCRT window, vim's screen area remains constant. If I maximize SecureCRT, vim continues to only occupy a portion of the terminal.
I have fiddled with the obvious setting choices but have been unable to get vim to adjust to the width of the terminal window.
It DOES work when using ConEmu.
Any ideas?

Same size to all TabItem in TabControl

It looks like simple issue but I failed to figure out how to do it.
I have a TabControl inside window with two TabItem. One of the TabItem has a fixed size content while the other TabItem's content is changing by the user mode.
I don't want to set the size of the window fixed to the biggest content.
I want the window to extend and shrink by the mode user chooses, but when user chooses a mode, I want both tabs to be the same size.
The TabControl HorizontalElignment was set to Streach.This didn't help because the window width itself changes by the content. Is there any way to set the smaller TabItem size and bind to the Larger one? Or maybe there is other solution?

Resources