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

Reset tmux options after showing notification #27

Open
docwhat opened this issue Nov 10, 2016 · 1 comment
Open

Reset tmux options after showing notification #27

docwhat opened this issue Nov 10, 2016 · 1 comment

Comments

@docwhat
Copy link

docwhat commented Nov 10, 2016

Currently in Guard, if I use:

notification(
  :tmux,
  display_message: true,
  timeout: 5, # in seconds
  default_message_format: '%s >> %s',
  # the first %s will show the title, the second the message
  # Alternately you can also configure *success_message_format*,
  # *pending_message_format*, *failed_message_format*
  line_separator: ' > ', # since we are single line we need a separator
  color_location: 'status-left-bg', # to customize which tmux element will change color

  # Colors
  default_message_color: 'colour222',
  default: 'colour27',

  success_message_color: 'colour16',
  success: 'colour82',

  failed_message_color: 'colour16',
  failed: 'colour196',

  pending_message_color: 'colour16',
  pending: 'colour220',

  # Notify on all tmux clients
  display_on_all_clients: false
)

Then when I use the status line for anything else, it isn't my default global color but one of the ones above.

An example is showing the "wrong" colors is:

$ tmux command-prompt -p "ssh: " "new-window -n 'ssh/%1' 'ssh %1'"
$ tmux show-options
message-style fg=colour16,bg=colour82
status-left-style bg=colour82

I would like it after each notification that it restores the colors by doing tmux set-option -u on each of the values it set.

@docwhat
Copy link
Author

docwhat commented Nov 10, 2016

A workaround is to unset all color things; which is not as pretty:

    change_color: false,

    success: nil,
    failed: nil,
    pending: nil,

    default_message_color: nil,
    default: nil,

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

1 participant