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

Suggestion: Red color when pane is dead #122

Closed
tzachshabtay opened this issue Apr 2, 2019 · 7 comments
Closed

Suggestion: Red color when pane is dead #122

tzachshabtay opened this issue Apr 2, 2019 · 7 comments

Comments

@tzachshabtay
Copy link

We run xpanes with a lot of micro-services and sometimes it's hard to see when a service dies. It would be nice if the Pane is dead message was colored red, or even better, it the pane name label background changed from green to red when that happens.

@greymd
Copy link
Owner

greymd commented Apr 3, 2019

Great idea!
I think I can add new shell variable to change the format of the default message.
And it might be better to make the default message have red background.

I will work on it next release.
But it may take much time due to my another work.
Stay tuned.
Or, pull requests are always welcome if you hope :)

@greymd
Copy link
Owner

greymd commented May 3, 2019

even better, it the pane name label background changed from green to red when that happens.

Executing tmux select-pane -T "#[bg=red,fg=black] #T #[default]" is the workaround as of xpanes v4.1.0

$ xpanes -tsc 'YOUR_COMMAND; tmux select-pane -T "#[bg=red,fg=black] #T #[default]"' _

@greymd
Copy link
Owner

greymd commented May 8, 2019

Default message can be changed by TMUX_XPANES_PANE_DEAD_MESSAGE variable.
See https://github.com/greymd/tmux-xpanes#tmux_xpanes_pane_dead_message

This feature was released at v4.1.1.

@greymd greymd closed this as completed May 8, 2019
@tzachshabtay
Copy link
Author

Great, thanks!
When are you going to upload to brew?

@greymd
Copy link
Owner

greymd commented May 8, 2019

After this PR is merged, you'll be able to use it. (Many thanks @bepsvpt !).
Homebrew/homebrew-core#39580

Have a ☕️ and wait.

@tzachshabtay
Copy link
Author

While waiting I tried using the select-pane as you described but it doesn't seem to work correctly -> it sometimes marks the wrong panes in red.
From looking at man tmux I didn't see what's the behavior for select-pane when you don't provide a target pane with -t, but I guess it doesn't do what we want it to do (i.e to use the pane we're running from).
I didn't see a built-in way in tmux to get the pane id from which we're running, is there maybe a variable that xpanes provides for this?

@greymd
Copy link
Owner

greymd commented May 10, 2019

As you pointed out, my workaround does not work as expected, sorry.

I didn't see a built-in way in tmux to get the pane id from which we're running, is there maybe a variable that xpanes provides for this?

We can get index number of pane like this.

tmux display -pt "${TMUX_PANE}" "#{pane_index}"

And, this workaround works in my environment.

$ xpanes -tsc 'INDEX=`tmux display -pt "${TMUX_PANE}" "#{pane_index}"`; sleep {}; tmux select-pane -t $INDEX -T "#[bg=red,fg=black] #T #[default]"' 1 2 3 4 5 6 7

To register the alias of xpanes command might be helpful for you.
https://github.com/greymd/tmux-xpanes/wiki/Alias-examples#get-index-number

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

2 participants