arl / gitmux

:computer: Git in your tmux status bar
MIT License
630 stars 24 forks source link

Trailing space #94

Closed joshmedeski closed 1 year ago

joshmedeski commented 1 year ago

Purpose

As a user, I want to render gitmux between other elements on my tmux status bar. I need a space between the elements but I don't want any unnecessary spaces if gitmux doesn't return anything leaving the tmux prompt pixel-perfect.

Approach

arl commented 1 year ago

This is adding a trailing unconditionally, so this is no different than adding a ' ' at last component of your layout. Ad documented in https://github.com/arl/gitmux#layout-components you can add anything to your layout, like:

layout: [branch, .., remote-branch, divergence, flags, ' ']
arl commented 1 year ago

Also, I thought that your issue was solved with #93. The other case as far as I'm aware of when gitmux can output an empty string is if you're not in a git directory, which you can easily get with git rev-parse --is-inside-work-tree in your tmux.conf. I'm not sure the feature you're asking is gitmux's responsibility to solve

joshmedeski commented 1 year ago

Totally fair, I'm not sure exactly where I got confused with why I was getting more spaces than I wanted.

Seems this is irrelevant, thanks for clarifying! I'll be playing with git worktrees soon.

Loving how gitmux is shaping up btw, I'll let you know if I come up with any more ideas. 😄

arl commented 1 year ago

Sure. Please do!!! Cheers