Skip to content

Conversation

joshmedeski
Copy link
Contributor

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

  • Add a trailing_space option to gitmux (default to false)
  • Render a trailing space to the layout when the option is true.

@arl
Copy link
Owner

arl commented Mar 22, 2023

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
Copy link
Owner

arl commented Mar 22, 2023

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
Copy link
Contributor Author

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. 😄

@joshmedeski joshmedeski deleted the trailing-space branch March 22, 2023 16:24
@arl
Copy link
Owner

arl commented Mar 22, 2023

Sure. Please do!!!
Cheers

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

Successfully merging this pull request may close these issues.

2 participants