arl / tmux-gitbar

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

Add length limitation on the branch+remote string, or the whole bar #44

Open arl opened 7 years ago

arl commented 7 years ago

When the name of current branch is relatively long, the branch+remote substring eats so much space that few tmux windows name, if any, become readable or visible.

Example: image

This problem would easily be solved by truncating the branch+remote substring. A sensible default in tmgb.conf + possibility to disable the truncating (with xxx_length=-1 or 0?). I guess the truncation could take effect on each component of the substring, replacing truncated parts with ellipsis, so as to still show the beggining of the current branch, and the beggining of the remote.

I guess providing a percentage would give better results than an absolute length.