Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTK: Add "Split Left" and "Split Up" actions to the menubar/context menu #5779

Open
pluiedev opened this issue Feb 15, 2025 · 7 comments · Fixed by #5807 · May be fixed by #5781
Open

GTK: Add "Split Left" and "Split Up" actions to the menubar/context menu #5779

pluiedev opened this issue Feb 15, 2025 · 7 comments · Fixed by #5807 · May be fixed by #5781
Labels
contributor friendly A well-scoped, approachable issue for someone looking to contributor. gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/linux

Comments

@pluiedev
Copy link
Contributor

pluiedev commented Feb 15, 2025

Discussed in #5535

Originally posted by edrozenberg February 2, 2025
Ghostty 1.1.0

Currently on Mac, Ghostty shows "Split Right" and "Split Down" in the menubar.

Suggestion:
Add "Split Left" and "Split Up" to the menubar even if by default they might have no keybindings assigned.

In my Ghostty config I'm using the following on Mac. I decided to use e and o bindings, similar to Linux, bc I personally remember these more easily (v e rtical) / (h o rizontal).

keybind = cmd+e=new_split:right
keybind = shift+cmd+e=new_split:left
keybind = cmd+o=new_split:down
keybind = shift+cmd+o=new_split:up

The modified "Right" and "Down" bindings show up properly in the Mac menubar, but "Left" and "Up" don't show up at all, even though they are active and function as defined in the config.

Motivation: in many cases, the user may need to split to the left or up to organize their workspace around existing content (an already open editor etc). If these options are not available in the menubar, the user may not realize this is possible, unless they specifically enable keybindings for these actions in the config file. And even when they add these bindings to the config file, they are not currently exposed in the menubar and may be overlooked/forgotten.

I assume but haven't checked that something similar might make sense on Linux, if these menu options are also missing there.


Maintainer's note: This is missing on Linux also. #4952 attempted to fix it but it was caught in a much wider array of changes. I think it would be better if we can have one or two focused PRs that would fix this for Linux and/or macOS instead.

@pluiedev pluiedev added gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/macos contributor friendly A well-scoped, approachable issue for someone looking to contributor. and removed os/macos labels Feb 15, 2025
@pluiedev
Copy link
Contributor Author

A side note but for me "Split Up" and "Split Left" sound a bit funny (maybe it's a English-as-a-second-language thing, dunno). Perhaps calling them "Split Upwards", "Split Leftwards", ... would make more sense?

@mitchellh
Copy link
Contributor

A side note but for me "Split Up" and "Split Left" sound a bit funny (maybe it's a English-as-a-second-language thing, dunno). Perhaps calling them "Split Upwards", "Split Leftwards", ... would make more sense?

I think at least for macOS, the better long term solution is a custom view similar to the Linux issue that has arrows of the directions to avoid any English whatsoever. For now, I think matching the keybinds is fine and I plan on merging #5807 for macOS.

@mitchellh mitchellh reopened this Feb 16, 2025
@mitchellh mitchellh changed the title Add "Split Left" and "Split Up" actions to the menubar/context menu GTK: Add "Split Left" and "Split Up" actions to the menubar/context menu Feb 16, 2025
@mitchellh
Copy link
Contributor

Also, as a point of background: the reason I only have right/down is because iTerm2 only has right/down. Beyond that, I thought it would be cognitively simpler for users to have just a vertical/horizontal option in the menus, but I'm willing to accept it doesn't really matter.

@jcollie jcollie linked a pull request Feb 16, 2025 that will close this issue
@jcollie
Copy link
Collaborator

jcollie commented Feb 16, 2025

#5781 has menu items for split up/left but does not add any keybinds.

@pluiedev
Copy link
Contributor Author

pluiedev commented Feb 16, 2025

I thought it would be cognitively simpler for users to have just a vertical/horizontal option in the menus, but I'm willing to accept it doesn't really matter.

One data point: Konsole actually only has "Split View Left/Right" and "Split View Top/Bottom" (as well as "Split Automatically", so perhaps it's not so bad to only have two split directions if we support moving/reordering splits (buuuuut we don't, which makes splitting in four directions more important IMO)

@matthebrown
Copy link
Contributor

#5781 has menu items for split up/left but does not add any keybinds.

Are we looking to add default keybinds for these split up/left? If so, I can certainly add them in another change.

@mitchellh
Copy link
Contributor

No I would consider that a separate discussion. I don’t think it’s necessary but regardless it should be discussed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor friendly A well-scoped, approachable issue for someone looking to contributor. gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/linux
Projects
None yet
4 participants