arl / tmux-gitbar

Git in your tmux status bar
GNU General Public License v3.0
170 stars 16 forks source link

Unnecessarily overwriting status-left or right #28

Closed adrianluff closed 8 years ago

adrianluff commented 8 years ago

Presently tmux-gitbar overwrites the entire status-left or status-right tmux configuration. While the default status line is restored this limitation restricts TMGB's utility.

Consider tmux-gitbar.sh line 176:

tmux set-window-option -a "status-$TMGB_STATUS_LOCATION" "$status_string" > /dev/null

replaced with:

tmux set-window-option "status-$TMGB_STATUS_LOCATION" "$TMGB_OUTREPO_STATUS" > /dev/null
tmux set-window-option -a "status-$TMGB_STATUS_LOCATION" "$status_string" > /dev/null

The new behavior is to restore the default each time, then ADD (-a) the TMGB information to the user's existing tmux status line.

arl commented 8 years ago

Hi Adrian, thank for your input, that seems legit. FYI i took the initiative to split this issue into two different ones because they are not directly dependent, so i edit your issue text and copied the second part into #30

For current issue, I'll have a look into it to see if there can't be side effects, though i guess not.

arl commented 8 years ago

Ok, i created PR #31 to fix this issue. Previous statuses are not overwritten anymore. Thanks for the input again. Basically i'm appending the tmgb status to the previous one, after having also restored the out-of-repo style, meaning that different style should coexist on the same part of the tmux status bar. Before merging this PR, I'd be very happy to hear about you @adrianluff and know if there are any side effects.

adrianluff commented 8 years ago

The only issue I've observed running with this for the last few weeks is an occasional visible screen redraw when tmux updates the status line twice in quick succession. That seems like a tmux issue though.

I will update with the latest PRs and report back as soon as I'm able.

arl commented 8 years ago

Great!

arl commented 8 years ago

I just thought about the issue you are talking about, it's probably the consequence of the two successive calls to set-window-option, both triggers a status line redraw. In my PR I didn't think of that and will update it accordingly, strings concatenation should be performed in bash where possible and the result sent to tmux, triggering an unique status redraw

Le 7 août 2016 18:41, "adrianluff" notifications@github.com a écrit :

The only issue I've observed running with this for the last few weeks is an occasional visible screen redraw when tmux updates the status line twice in quick succession. That seems like a tmux issue though.

I will update with the latest PRs and report back as soon as I'm able.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aurelien-rainone/tmux-gitbar/issues/28#issuecomment-238092918, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdF6t4jt5ne55HTDn_AHVGzXbkeXD7pks5qdgrXgaJpZM4JOTOf .

adrianluff commented 8 years ago

I was able to test your pull request for this issue. Works great here!

arl commented 8 years ago

Closing, #30 has been merged into master