arl / gitmux

:computer: Git in your tmux status bar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gitmux loads only once

qejecooo opened this issue · comments

Greetings! Using the gitmux and after I make tmux kill-server and make a new session it stops working. Any ideas?
Shell: Bash
Ubuntu 20.04
.tmux.conf:

set-environment -g PATH "$HOME/bin:/home/d.stolbov/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$HOME/go/bin:$HOME"

# remap prefix from 'C-b' to 'C-a'

unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

unbind C-d
# split panes using | and -
bind q split-window -h
bind s split-window -v
unbind '"'
unbind %

# don't rename windows automatically
set-option -g allow-rename off

# start window index at 1
set -g base-index 1

# start pane index at 1
set -g pane-base-index 1

# re-number windows when one is closed
set -g renumber-windows on

## Capture current tmux buffer and copy it to system clipboard with prefix + 'Ctrl + c'
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"

## Optional - paste from system clipboard to tmux session with prefix + 'Ctrl + v'
## bind C-v run "tmux set-buffer "$(xclip -o -sel clipboard)"; tmux paste-buffer"

#copy and paste vim style

## Enable vi-copy-mode
setw -g mode-keys vi

# Turn off mouse and use vim keys for navigations
# turn this on if you want to use touchpad or mouse to scroll through terminal
setw -g mouse off

## changing the key to enter copy mode from `[` to `ESC`
unbind [
bind Escape copy-mode

## unbind p and set it to paste from buffer
unbind p
bind p paste-buffer

## set keys for visual mode (v) and yank/copy (y)
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'

## reload tmux config
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded tmux config!"
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"

bind u command-prompt -I "#W" "rename-window '%%'"

set -goq @themepack-status-right-area-left-prefix "#(gitmux -cfg .gitmux.conf #{pane_current_path})"
set -goq @themepack-status-left-area-middle-suffix "🐶"

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'jimeh/tmux-themepack'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @themepack 'powerline/double/yellow'

set -g @resurrect-strategy-nvim 'session'
set-option -sg escape-time 10

# Initialize TMUX plugin manager
run '~/.tmux/plugins/tpm/tpm'

Hi @qejecooo

gitmux is made to only prints to standard output if there were no errors during execution.
This is important since otherwise would spam the user terminal in case of misconfiguration.
That's probably what's happening here.

Some hints:

First, in your tmux.conf I see:

set -goq @themepack-status-right-area-left-prefix "#(gitmux -cfg .gitmux.conf #{pane_current_path})"

Try to provide an absolute path instead of .gitmux.conf so as to make the working directory an invariant.

--

Also, you can force gitmux to print something to ease debugging. Pass the --dbg option to gitmux.

Finally, if nothing works.
Try with a temporary, minimal .tmux.conf to check for potential conflicts between tmux and tpm-plugins though it seems unlikely.

I didn't try OP's tmux.conf but this is likely the same issue as #89 since I see tmux-continuum in the config.

Closing, no answer after 2 years. please reopen if needed, thanks