Proposal: Native Scripting Support (JS/Lua/mruby/Python/WASM?) #4574
Replies: 1 comment 1 reply
-
|
This is a difficult one. I am not completely opposed to this idea, I would quite like to be able to get rid of or simplify a lot of the stuff that tmux does itself like command parsing, hooks, etc, and delegate them to an embedded language. However, it would be difficult. There are a couple of major issues: The first is that importing any kind of scripting language into the base system would be a very hard sell. It was discussed a long time ago for mg - there was mention of Lua, as well as some Scheme or Lisp variant. I said then that if a scripting language was imported for mg I would use it for tmux, but IIRC the discussion faded away without resolution. Still, my impression was there was little enthusiasm for the idea. So, the best approach would be to do it in such a way that only portable is impacted, meaning that OpenBSD tmux continues to work. Any use of an embedded language would need to be optional, to parallel existing features, or extend them, rather than replacing them. But I definitely don't want that forever - the point of an embedded language is to make things simpler and more flexible, not to have two ways of doing everything. So at some point in the future once the integration was proven, we would have to make a decision whether to try to get the language imported into OpenBSD, or to keep it as optional but remove some features if built without, basically having "tmux" and "tmux-light". The second issue that this would be a lot of work, multiple years, and it would need to be done carefully. It is not easy to properly integrate an embedded language into an existing C program, and I've seen it fail before. So I would like to see a plan for how it would look, what features would be added, extended, replaced, and in what order, and so on. As far as languages go:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi tmux community,
I’d like to propose adding native scripting language support to tmux to enhance customization and automation. While shell-based scripting with
tmuxcommands works, a dedicated scripting interface could:Simplify Complex Logic
Improve Performance
tmuxcommand subprocess calls.Enable Sharing & Plugins
Potential Language Options
Why Consider mruby?
Example Use Cases
on-client-attachedto trigger scripts.Discussion Questions
I’m happy to prototype this if the idea aligns with tmux’s direction. Projects like Zellij’s WASM and Neovim’s Lua show demand for deeper extensibility.
Beta Was this translation helpful? Give feedback.
All reactions