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

Tmux notifier modifies color_location for all tmux sessions #781

Closed
kaldrenon opened this issue Jul 15, 2015 · 4 comments
Closed

Tmux notifier modifies color_location for all tmux sessions #781

kaldrenon opened this issue Jul 15, 2015 · 4 comments

Comments

@kaldrenon
Copy link

I regularly have multiple tmux sessions at one time (usually one for each repo), and guard's tmux settings are updating the status-left-bg (my setting for color_location) for every session when test runs complete.

I'd like them to only update the color_location for the session that guard is currently in.

Is there a way to do this currently? If not, I'm requesting that it be added.

Here's my config for tmux in guard right now:

  notification :tmux,
    display_message: true,
    timeout: 5, # in seconds
    default_message_format: '%s >> %s',
    success_message_format: 'PASSED -> %s >> %s',
    failed_message_format:  'FAILED -> %s >> %s',
    line_separator: ' > ', # since we are single line we need a separator
    color_location: 'status-left-bg', # to customize which tmux element will change color

    # Other options:
    default_message_color: 'black',
    success: 'colour150',
    failure: 'colour174',
    pending: 'colour179',

    # Notify on all tmux clients
    display_on_all_clients: false
@e2
Copy link
Contributor

e2 commented Jul 16, 2015

If you run guard with the '-d' option, it should show you all the tmux commands run.

This feature would be implemented in the Notiffany project - and for properly linking it's best to post an issue there, but I don't mind.

Notiffany source code for TMux is here:

https://github.com/guard/notiffany/blob/master/lib/notiffany/notifier/tmux.rb#L72

As you can see, it uses TMux's display-message for the notification - and regarding the color_location, it uses TMux's set-option command here:

https://github.com/guard/notiffany/blob/master/lib/notiffany/notifier/tmux.rb#L64

As you can see, it sets the '-t' option for set-option using the client parameter - it may just be a matter of adding a display_on_all_sessions option (I don't have a better idea for anything more specific ATM).

I can't look further into this, but if you tell me what tmux commands you expect (vs the current ones appearing) I could create a patch.

@kaldrenon
Copy link
Author

Thanks for the feedback! I will take a look at the code and see if I can PR
a patch for the desired behavior.

On Wed, Jul 15, 2015 at 8:43 PM Cezary Baginski notifications@github.com
wrote:

If you run guard with the '-d' option, it should show you all the tmux
commands run.

This feature would be implemented in the Notiffany
https://github.com/guard/notiffany project - and for properly linking
it's best to post an issue there, but I don't mind.

Notiffany source code for TMux is here:

https://github.com/guard/notiffany/blob/master/lib/notiffany/notifier/tmux.rb#L72

As you can see, it uses TMux's display-message for the notification - and
regarding the color_location, it uses TMux's set-option command here:

https://github.com/guard/notiffany/blob/master/lib/notiffany/notifier/tmux.rb#L64

As you can see, it sets the '-t' option for set-option using the client
parameter - it may just be a matter of adding a display_on_all_sessions
option (I don't have a better idea for anything more specific ATM).

I can't look further into this, but if you tell me what tmux commands you
expect (vs the current ones appearing) I could create a patch.


Reply to this email directly or view it on GitHub
#781 (comment).

@kaldrenon
Copy link
Author

guard/notiffany#16

@rymai
Copy link
Member

rymai commented Sep 22, 2015

I'm closing this since it's handled in guard/notiffany#16 now.

@rymai rymai closed this as completed Sep 22, 2015
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

No branches or pull requests

3 participants