as i think was mentioned, a variable with session information would
really make this most useful. my particular use case is: i'd like
bell-action to send a desktop-notify message with the last x
characters of the session that caused the bell. with this, i could get
the notification, but can't tell where it came from.

ps - i'm also unsure how to get the buffer from a session (but this
should probably be a different thread)

On Tue, Nov 6, 2012 at 12:55 PM, Thomas Adam <tho...@xteddy.org> wrote:
> Hi,
>
> On Tue, Nov 06, 2012 at 12:48:54PM +0000, Nicholas Marriott wrote:
>> On Sun, Nov 04, 2012 at 01:22:50AM +0000, Thomas Adam wrote:
>> > * The hook-name matters; at the moment the implementation assumes
>> >   cmd->entry->name and NOT cmd->entry->alias -- should both be checked?
>> >   That might mean though one can have a hook with both "new-window" and
>> >   "neww" defined, which is bad.
>>
>> No, just the name. before-new-window, after-new-window etc.
>
> OK.
>
>> > * Per-session hooks are only ever enacted if the command sent to them comes
>> >   from the client attached to that session.  So for example, if I have this
>> >   binding:
>> >
>> >   set-hook -nfoo -n'after-new-window' 'run "notify-send new window..."'
>> >
>> >   and I run the following from either outside of an attached tmux session,
>> >   or some other session which ISN'T "foo":
>> >
>> >   tmux new-window -tfoo
>> >
>> >   then I will never see the specified hook run.
>> >
>> >   This is because the cmd_ctx used to run hooks only knows about the 
>> > context
>> >   of where the command was run *from*.  I'm wondering how much of a 
>> > drawback
>> >   this will be, or whether this makes sense?  I'm not sure it does though
>> >   because if I manipulate a session from some other session which has 
>> > hooks,
>> >   I'd expect those hooks to run.
>> >
>> >   To "fix" this, we would need to change where and how hooks are run from,
>> >   much like the notify_() hooks do now, but there would then be no
>> >   before/after mechanism.
>>
>> Hmm. Perhaps having per-session hooks doesn't make much sense.
>
> I think it does -- especially since a command can be invoked directly on the
> client attached to a session and from outside of it.
>
>> >
>> > * At present, there's no information passed down to commands about the hook
>> >   being run.  For example if I had this:
>> >
>> >   set-hook -nfoo -n'after-new-window' 'run "my_shell_script.sh"'
>> >
>> >   we should provide some information such as the session name, etc., so 
>> > that
>> >   external commands can manipulate what ever they need to in context.
>>
>> Run the command through as a format?
>
> Yeah, I considered that, but wasn't sure if that was good enough.  Do you
> want me to update this diff with this change?
>
> Kindly,
>
> -- Thomas Adam
>
> ------------------------------------------------------------------------------
> LogMeIn Central: Instant, anywhere, Remote PC access and management.
> Stay in control, update software, and manage PCs from one command center
> Diagnose problems and improve visibility into emerging IT issues
> Automate, monitor and manage. Do more in less time with Central
> http://p.sf.net/sfu/logmein12331_d2d
> _______________________________________________
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to