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

PoC: add support for all known pane modes #39

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jyscao
Copy link

@jyscao jyscao commented Oct 21, 2023

Hi @erickpintor, I want to bring to your attention that the way the pane-modes are currently displayed is incorrect. The error occurs on this line (and the related line 2 lines above), where it's assumed that if a pane is in a mode, it's necessarily in copy mode.

I'm not sure if it was the case that tmux only had copy mode back in 2015 when this plugin was first created, but in its present version, it now contains a number of different pane modes. The ones that I've been able to identify besides copy mode are:

  • view-mode (list-keys command, or the default prefix + ? keybind)
  • tree-mode (choose-tree command, or the default prefix + s and prefix + w keybinds)
  • client-mode (choose-client command, or the default prefix + D keybind)
  • buffer-mode (choose-buffer command, or the default prefix + = keybind)
  • options-mode (customize-mode command)
  • clock-mode (clock-mode command, or the default prefix + t keybind)

This PR contains a quick and dirty patch I did to add support for these additional pane modes. And you can see some examples below:

View mode:
image

Copy mode:
image

Buffer mode:
image

At this point, I just want to bring this to your attention as I already mentioned, and I do not intend this to be the final version that gets merged, should you agree that this is indeed in need of fixing. And if that's indeed the case, here are some implementation details that would need to be addressed:

  • variable names in the script should be updated to reflect their new purposes, e.g. instead of copy_mode, probably something like pane_mode is more apt
  • add user configurable prompt texts, e.g. prefix_highlight_tree_prompt and prefix_highlight_options_prompt, which are currently hardcoded as Tree and Opts respectively
  • possibly rethink the entire mechanism for implementing the different pane modes' prompts; as you can see, they're currently done using nested tmux formatting conditionals, which is ugly and clunky to say the least; perhaps an external script is needed; your input on how best to achieve this is definitely welcome

slange-dev added a commit to slange-dev/tmux-prefix-highlight that referenced this pull request Jan 4, 2025
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 this pull request may close these issues.

1 participant