Ok so this is cool and it's great you can do this kind of stuff. And thanks for 
showing it. But I'm not going to add it to tmux.

If we ever add an external scripting language to tmux then it'll have to be 
done carefully and will be quite a big process. A process I don't have time or 
inclination to get involved in right now.

tmux is not just a standalone project, it is also part of OpenBSD and people 
will be very resistant (with good reason) to adding a new large, unaudited 
dependency to tmux. As will many users be outside of OpenBSD. So they will need 
to be sold on clear benefits which I don't really see that strongly myself.

Also it isn't enough just to add a couple of commands to tmux. It has to be 
integrated properly, and that means both providing all the necessary APIs and 
replacing existing code. Maybe not everything and maybe not immediately but 
certainly I'd like git diff to show me a lot of minus signs and the potential 
for a lot more. I think I'd want it to be clearly achievable for 80% of 
commands to be changed eventually and we'd probably need 20% or so in the first 
step. Also the new code would have to my eye be simpler and cleaner than 
writing them in C in the first place.

So not now and not like this.

Personally I think there is already room for improving and sinplifying tmux's 
internal APIs in C - Thomas and I were discussing some case a few weeks ago. 
That's what I would work on now which could both make existing code simpler and 
later make it easier to add hooks for lua or whatever if we ever go down that 
road.

Also I am as always particularly open to ideas making it simpler and easier to 
use tmux from the shell.

-------- Original message --------
From: Jared Stafford <jspeng...@jspenguin.org> 
Date: 08/08/2013  21:53  (GMT+00:00) 
To: tmux-users@lists.sourceforge.net 
Subject: Patch with Lua support (+more) 
 
A while ago I wrote a patch for tmux to add Lua support. This adds a
bit more flexibility and performance over writing a shell script that
just runs tmux commands; for instance, you can have lua code that runs
when a window or session is created or destroyed:

function tmux.oncreate.window_pane(wp)
   tmux.send('-t', '%' .. wp.id, 'hello!')
end

This patch adds two commands:

lua-call (lcall): Calls a Lua function in the global environment,
either built-in or user-defined The first parameter is the name of the
function to call, and any extra parameters are passed as strings to
the function. Typically you would run lua-call eval '<lua-code>' or
lcall dofile '<lua-file>' to define functions, then call them with
another lua-call.

lua-reset: Resets the Lua interpreter, clearing out all definitions and hooks.

There is also an option called lua-timeout, which is the number of
milliseconds that Lua code is allowed to run without letting the event
loop run.

This patch also contains options to highlight the status bar when the
prefix key is pressed:

prefix-notify (flag): When 'on', the following options will override
the corresponding options while waiting for a prefix command:

status-left-prefix,
status-left-attr-prefix,
status-left-bg-prefix,
status-left-fg-prefix,
status-right-prefix,
status-right-attr-prefix,
status-right-bg-prefix,
status-right-fg-prefix,
set-titles-string-prefix

I have attached the patch file, which should be applied against git
commit 84c22d053b5ec1cd25e1694fa3889922b9cbe11b.
I didn't include the Lua interpreter itself, but you can download it
from http://www.lua.org/ftp/lua-5.2.2.tar.gz . Just extract that, then
copy the directory lua-5.2.2/src/ to <tmux>/lua/.

- Jared Stafford (jspeng...@jspenguin.org)

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to