ghostty icon indicating copy to clipboard operation
ghostty copied to clipboard

Add action to create left split with custom size

Open idr4n opened this issue 1 year ago • 9 comments

Since there is new_split:right, new_split:dow, and new_split:top, I think it would be nice to have new_split:left as well.

Additionally, it would be great to be able to create splits of a given size, for example: new_split:left,30 would create a split to the left 30% the size of the surface.

I think this is the only feature that I am missing from WezTerm and Kitty 😅 . Otherwise, Ghostty is the perfect merge between a native feel terminal in macOS like iTerm (preserving window size and directory after restart) and the speed of Alacritty, with the features of WezTerm or Kitty.

Thanks for an awesome terminal!

idr4n avatar Sep 12 '24 16:09 idr4n

BTW there isn't actually a new_split:top — Ghostty currently only does right and down splits due to how the split tree is internally structured. I'll see what I can do to implement it though

EDIT: Speedran through adding this in 9 minutes.

https://github.com/user-attachments/assets/604c3246-4707-446a-bc6d-37a3c085f107

pluiedev avatar Sep 16 '24 10:09 pluiedev

@pluiedev you are absolutely right, my bad. I should have gotten confused with goto_split:top 😅.

idr4n avatar Sep 16 '24 18:09 idr4n

We now have split left and up thanks to @pluiedev from #2255. I'm still open to accepting sizes as well. I think my preferred syntax would be very close to what is suggested with one change:

new_split:left,30%

Requiring a % there so we have units.

mitchellh avatar Oct 08 '24 16:10 mitchellh

We now have split left and up thanks to @pluiedev from #2255. I'm still open to accepting sizes as well. I think my preferred syntax would be very close to what is suggested with one change:

new_split:left,30%

Requiring a % there so we have units.

Hi @mitchellh. Just pushed a PR with my take on adding custom size splits using the suggested syntax.

idr4n avatar Nov 01 '24 12:11 idr4n

From #3839, I also propose we support an additional size that is a non-% for balancing splits after creation. I'm not sure what this should be, but it should be easy to support since we already support split equalization.

mitchellh avatar Dec 29 '24 03:12 mitchellh

What if we just supported chaining actions? Something like this:

new_split:left,equalize_splits

jrnxf avatar Jan 04 '25 11:01 jrnxf

That’s actually a much better suggestion. That’s already being planned in discussion so we should go with that

mitchellh avatar Jan 04 '25 14:01 mitchellh

new_split:left,equalize_splits would be perfect for me coming from iterm2 and loving how it equalizes

em avatar Jan 06 '25 05:01 em

I hate those bump up messages, but I've just found this thread and I have an interest in the equalize_splits possibility. Any update about implementing it?

juliogc avatar May 07 '25 19:05 juliogc

Should the action new_split support equalize_splits, or should this problem be pushed off for #3175?

Multiple actions are highly desired. And it would make more sense that you chain this together.

Regardless, I am working on an implementation right now. I am designing it in a way to support future options beyond just %. Unsure how much more complicated it would be to add equalize_splits, but at least parsing it will be easy given my current implementation. Even if my final logic isn't used, my parsing logic seems valid / useful for this issue.

CoderJoshDK avatar Sep 26 '25 19:09 CoderJoshDK