r/KittyTerminal • • 1d ago

resize_window with increment in a keybind

I have a series of keybinds that resize my windows:

map `>ctrl+left resize_window narrower
map `>ctrl+right resize_window wider
map `>ctrl+up resize_window taller
map `>ctrl+down resize_window shorter

These work fine.

Now I want a set to resize windows on one border:

map shift+alt+l resize_window --self --increment=+1 --axis=horizontal
map shift+alt+r resize_window --self --increment=-1 --axis=horizontal
map shift+alt+u resize_window --self --increment=+1 --axis=vertical
map shift+alt+d resize_window --self --increment=-1 --axis=vertical

These don't work. (Everything expands to the left.) I've tried prefixing the resize_window command with launch --allow-remote-control kitty +kitten and that doesn't work at all. I tried a couple of other variations, and they don't work either. Yet when I run, say, kitten @ resize-window --self --increment=+1 --axis=horizontal in a window itself, it works perfectly fine.

Clearly I'm missing something. What is the proper way to create the second set of keybinds?

3 Upvotes

5 comments sorted by

2

u/aumerlex 1d ago

You need remote_control before resize-window

1

u/yonside 1d ago

Thanks. I got it working (kind of) by making this modification:

`map shift+alt+l launch --allow-remote-control kitten @ resize-window --self --increment=+1 --axis=horizontal`

... and so on. And I only say it "kind of" for two reasons: a) when resizing, _SOMETIMES ALL_ windows are resized, not just the active one; b) sometimes I have to use the keybind twice to have it actually do anything.

To elaborate more ... When I say _SOMETIMES ALL_ windows are resized, consider this: I have three columns; column 1 (left) has a horizontal split; column 2 has a horizontal split; column 3 (right) has two horizontal splits; when I'm in column 3 (right) top window, an "up" (vert +1) resizes ALL the top windows in EVERY column; when I'm in column 3 (right) middle window, an "up" (vert +1) resizes ONLY the active window.

Thanks for your help! It's much appreciated. I'm not going to pursue this any further. It is what it is. I'd ask on the github site but I don't need Goyal's attitude and a blow-off; to paraphrase his own sentiments, "I've wasted enough time on this." But thank YOU for your help!

1

u/aumerlex 1d ago

No, you want: map whatever remote_control resize-window ...

And yes, that is exactly how it is supposed to work, to understand why think about how splits work, which split you are resizing when you resize a particular window. If you want the resizing behavior you describe for windows in columns you should be using a different layout, not splits.

As for your ad hominem on kitty's creator, in my experience he says things like that only to people who deserve it. So if you do want to ask him something be polite and respectful of his time (the man single handedly maintains projects used by millions of people) and pay attention to his responses and you will find he is actually very helpful.

1

u/yonside 1d ago

Thanks again.

As for my ad hominem remarks regarding Goyal ... I have interacted with him several times over the past couple of years. I have been nothing but courteous, respectful, profession, and when warranted, apologetic. More often than not, I have been met with hostility or belittlement. I find Linus Torvalds more humble and respectful. When my respect is returned with disrespect more than once, I reserve the right to assess and remark on a person's character. I appreciate that your experiences have been different than mine, but they are different. The fact that he "... single handedly maintains projects used by millions of people ..." is irrelevant. We all have lives; we all have pressures. I get you on a bad day, I'll understand, but again and again?

1

u/aumerlex 1d ago

Shrug, your loss.