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

[feature request] add an option to enable tmux popup window borders #4156

Closed
4 of 10 tasks
aead opened this issue Jan 3, 2025 · 4 comments · Fixed by #4157
Closed
4 of 10 tasks

[feature request] add an option to enable tmux popup window borders #4156

aead opened this issue Jan 3, 2025 · 4 comments · Fixed by #4157

Comments

@aead
Copy link
Contributor

aead commented Jan 3, 2025

Checklist

  • I have read through the manual page (man fzf)
  • I have searched through the existing issues
  • For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.57.0

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

Currently, the tmux popup window is launched with:

tmuxArgs := []string{"display-popup", "-E", "-B", "-d", dir}

The -B flag disables the popup window border. This seems to be a good default. However, there are situations where it would be nice if the popup window had a border. For example, I have a fzf command listing git-log entries and a key binding that executes a pager for viewing the commit message or entire commit (including diff).

Without a popup border, the pager output isn't visually separated from the background and harder to read.

Screenshot 2025-01-03 at 13 18 40

vs.

Screenshot 2025-01-03 at 13 19 41

If customizing this should be supported, I see two ways to do this:

  • Allow tmux flags in the list of elements passed via --tmux[=[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]]]
    For example, --tmux[=[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]],[-B],[-E],[-d DIR]]. If no flags are
    specified, the current list of default flags is applied.
  • Add a new flag --tmux-flags that contains a list of flags passed to tmux popup. Again, if not specified, the current
    list of default flags is applied.
@aead aead changed the title tmux: add an option to enabling tmux popup window borders tmux: add an option to enable tmux popup window borders Jan 3, 2025
@aead aead changed the title tmux: add an option to enable tmux popup window borders [feature request] add an option to enable tmux popup window borders Jan 3, 2025
@aead
Copy link
Contributor Author

aead commented Jan 3, 2025

Another variation of the above proposed solution would be extending the --tmux flag to:

--tmux[=[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]][,border]]

which would wrap the tmux interface and not expose tmux flag names as part of the fzf interface.

@junegunn
Copy link
Owner

junegunn commented Jan 3, 2025

There is an ongoing discussion where we're trying to abstract --tmux into --popup and support both tmux, zellij, and any alternative that would allow you to open a popup window. See #4145

So considering that, I'd like to avoid leaking any tmux-specific options to the users, so I prefer your last suggestion, but the word border alone can easily be misunderstood. We should be more specific, maybe something like border-native.

@junegunn
Copy link
Owner

junegunn commented Jan 3, 2025

Somewhat related: #4155

@aead
Copy link
Contributor Author

aead commented Jan 3, 2025

So considering that, I'd like to avoid leaking any tmux-specific options to the users, so I prefer your last suggestion, but the word border alone can easily be misunderstood. We should be more specific, maybe something like border-native.

Sounds reasonable to me. With a more generic --popup flag in mind the options should be generic as well and def. not leak popup-implementation specifics into the fzf interface. I can send a PR for the current --tmux flag. I assume it has to remain for backward compatibility anyway but becomes an alias for --popup eventually.

junegunn added a commit that referenced this issue Jan 4, 2025
This commit adds the `border-native` resulting in the following:

```
--tmux[=[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]][,border-native]]
```

By default, when not specified, the `-B` flag is passed to the
`tmux popup-window` command such that no border is drawn around
the tmux popup window.

When the `border-native` option is present, the `-B` flag is omitted
and the popup window is drawn using the border style configured in
the tmux config file.

Fixes #4156

Signed-off-by: Andreas Auernhammer <[email protected]>
Co-authored-by: Junegunn Choi <[email protected]>
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

Successfully merging a pull request may close this issue.

2 participants