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

Add plugin_interpolated_options support #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ins0mniaque
Copy link

When using a multi-line status-format, having the interpolation restricted to status_left and status_right is problematic.

This adds an option to configure which options are interpolated by the plugin. Because there are multiple plugins using the same interpolation technique, and they are all subject to the same restrictions, I used "@plugin_interpolated_options" as the option name. That option could be reused by other plugins for the same purpose.

If the option is not found, it defaults to "status-right status-left", the current behavior.

To support multi-line status-format, the status line to interpolate can be added to @plugin_interpolated_options in ~/.tmux.conf:

set -g @plugin_interpolated_options 'status-format[0] status-left status-right'

This option also allows a very small improvement in startup performance by only interpolating the necessary options. For example, to only interpolate status-right:

set -g @plugin_interpolated_options 'status-right'

@ctjhoa
Copy link
Member

ctjhoa commented Apr 6, 2022

Documentation is missing.
However, I'm ok with your solution but I will wait on tmux-plugins/tmux-battery#103 decision before merging.

@ins0mniaque
Copy link
Author

I might have been a bit zealous when I did this, but there's also: tmux-plugins/tmux-prefix-highlight#37, tmux-plugins/tmux-maildir-counter#5, tmux-plugins/tmux-net-speed#15, tmux-plugins/tmux-newsboat#1 and tmux-plugins/tmux-online-status#18.

I'll add documentation to all of these as soon as possible, starting with tmux-cpu and tmux-battery.

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.

2 participants