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

Start floating pane at the center of the screen by default #3901

Open
junegunn opened this issue Dec 30, 2024 · 0 comments
Open

Start floating pane at the center of the screen by default #3901

junegunn opened this issue Dec 30, 2024 · 0 comments

Comments

@junegunn
Copy link

Problem Description

When you open a floating pane with the default width and height, it opens at the center of the screen.

zellij run --floating --close-on-exit -- top 

However, when you specify a non-default width and/or height, the position of the pane is not adjusted accordingly to remain centered.

zellij run --floating --close-on-exit --width 80% --height 80% -- top 

zellij run --floating --close-on-exit --width 30% --height 30% -- top 

So the users have to manually calculate the right coordinates to put it back at the center.

# (100% - 80%) / 2 = 10%
zellij run --floating --close-on-exit --width 80% --height 80% --x 10% --y 10% -- top 

This process is even more cumbersome when an absolute width or height is provided, because you need an extra step of getting the size of the terminal beforehand.

Suggestion

Always start a floating pane at the center of the screen regardless of the specified dimensions, so no manual calculation is needed.

Expected effect

Better user experience.

Alternative solution

Make --x and --y take special values like center or C, similar to -xC -yC in tmux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant