Skip to content

feat: added tmux plugin compatability layer#24

Open
LUIDevo wants to merge 1 commit into
Helvesec:mainfrom
LUIDevo:main
Open

feat: added tmux plugin compatability layer#24
LUIDevo wants to merge 1 commit into
Helvesec:mainfrom
LUIDevo:main

Conversation

@LUIDevo

@LUIDevo LUIDevo commented May 27, 2026

Copy link
Copy Markdown
Contributor

Problem:

Tmux plugin scripts are shell scripts that run tmux internally. rmux tried to parse .tmux files but failed silently, so tmux plugins were not compatible with rmux.

Solution:

We create a temporary directory using the tempfile crate, inside of it contains a fake tmux shim. When we run the tmux script, it calls this executable using a PATH override, which turns it into an rmux command.

There are other ways to implement this change, such as reading through the script and swapping every 'tmux' with 'rmux' but this implementation is cleaner and is less prone to breakages.

All code changes were implemented in rmux-server, as the implementation was minimal enough to not warrant another "rmux-shim" crate. Later, if needed, it can be extracted into its own crate.

The "extract_plugin_paths" function takes in commands and returns a list of strings of source files ending with .tmux.
"run_plugin_scripts" contains the shim logic and is called from a slightly modified handle_source_file function.

@LUIDevo LUIDevo changed the title added tmux plugin compatability layer feat: added tmux plugin compatability layer May 30, 2026
Sourcing a `.tmux` file now executes it as a shell script with a `tmux`
shim placed on PATH that proxies commands back to the running rmux server
over its socket. This lets tmux plugins (e.g. TPM-style `.tmux` entry
scripts) drive rmux directly, instead of being parsed as config.

The shim and script execution are Unix-only; the executable-bit setup is
gated behind cfg(unix) so the crate still builds on Windows.
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