soyuka / tmux-current-pane-hostname

Tmux plugin that enables displaying hostname and user of the current pane in your status bar.
MIT License
76 stars 23 forks source link

not working in tmux 2.5 #8

Open lcorsini opened 6 years ago

lcorsini commented 6 years ago

Hello, I'm trying to use your plugin with tmux 2.5 on ubuntu 17.10 the same configuration works on a mac with tmux installed via homebrew (it's tmux 2.4 or 2.6 sorry, don't have the mac here with me right now) but here it just seems to be ignored, #U is printed plaintext and #U doesn't change when I ssh into another host... any way to debug or fix this?

soyuka commented 6 years ago

Just compiled tmux again from master and this works fine here.

lcorsini commented 6 years ago

I don't really know what I'm missing, other plugins works, This is my actual configuration, I've copied it from my mac (el capitan) where pane hostname works fine instead `

Base Setup

set -g default-terminal "screen-256color" set-option -g default-shell /bin/zsh

new-session -n $HOST # if run as "tmux attach", create a session if one does not already exist

set -sg escape-time 10 # smaller keystroke delay set -g history-limit 300000 # increase history buffer size set -g set-clipboard on

set -g terminal-overrides "xterm*:XT:smcup@:rmcup@"

set -g terminal-overrides 'xterm*:smcup@:rmcup@'

set -g xterm-keys on setw -g monitor-activity on set -g visual-activity on

set -g utf8 on

set-option -g set-titles on

set-option -g set-titles-string '#{pane_current_command}'

set-window-option -g automatic-rename on

Mouse Setup

set -g mouse on

Key Bindings

set -g prefix C-a # Set Default PREFIX to Ctrl-a unbind C-b # clear default PREFIX keybind bind r source-file ~/.tmux.conf \; display "Reloaded!" # Reload configuration with PREFIX r bind C-a send-prefix # pressing PREFIX twice sends the combination to the running app

Split Panes

bind | split-window -h # bind PREFIX | to split window in two vertical panes bind - split-window -v # bind PREFIX - to split window in two horizontal panes unbind '"' unbind %

Sync Panes

bind C-s set-window-option synchronize-panes # PREFIX C-s syncronizes input in every pane

Copy&Paste

bind C-c run "tmux show-buffer | putclip" # PREFIX y syncs tmux buffer with system (WINDOWS) clipboard

bind C-v run "getclip | tmux load-buffer -" # PREFIX p syncs system (WINDOWS) clipboard with tmux buffer

Vim mode keys

setw -g mode-keys vi set -g status-keys vi

Vim style movement between panes

bind h select-pane -L # PREFIX h select left pane bind j select-pane -D # PREFIX j select lower pane bind k select-pane -U # PREFIX k select upper pane bind l select-pane -R # PREFIX l select right pane

Vim style resize panes

bind -r H resize-pane -L 5 # PREFIX H resize pane 5 columns to the left bind -r J resize-pane -D 5 # PREFIX J resize pane 5 rows down bind -r K resize-pane -U 5 # PREFIX K resize pane 5 rows up bind -r L resize-pane -R 5 # PREFIX L resize pane 5 columns to the right

moving between windows with vim movement keys

bind -r C-h select-window -t :- bind -r C-l select-window -t :+

y and p as in vim

bind Escape copy-mode unbind p bind p paste-buffer

bind -t vi-copy 'v' begin-selection

bind -t vi-copy 'y' copy-selection

bind -t vi-copy 'Space' halfpage-down

bind -t vi-copy 'Bspace' halfpage-up

Status Bar

set -g base-index 1 setw -g pane-base-index 1

set -g status-utf8 on

set -g status-interval 1 set -g status-left-length 50 set -g status-right-length 80

Colors

set -g pane-border-fg "colour248" set -g pane-active-border-fg "colour248"

set -g status-bg "colour237" set -g message-command-fg "colour237" set -g status-justify "left" set -g status-left-length "100" set -g status "on"

set -g pane-active-border-fg "colour109"

set -g message-bg "colour109" set -g status-right-length "100" set -g status-right-attr "none" set -g message-fg "colour237" set -g message-command-bg "colour109" set -g status-attr "none"

set -g status-utf8 "on"

set -g pane-border-fg "colour236"

set -g status-left-attr "none" setw -g window-status-fg "colour108" setw -g window-status-attr "none"

setw -g window-status-activity-bg "colour237"

setw -g window-status-activity-attr "bold"

setw -g window-status-activity-fg "colour109"

setw -g window-status-separator "" setw -g window-status-bg "colour237" set -g status-left "#[fg=colour237,bg=colour108]Session #S |#{?pane_synchronized, SYNC,} #[fg=colour108,bg=colour237]" set -g status-right "#[fg=colour236,bg=colour237]#[fg=colour108,bg=colour236] %H:%M:%S  %d %b %y #[fg=colour108,bg=colour236]#[fg=colour237,bg=colour108]  #h " setw -g window-status-format "#[fg=colour108,bg=colour237]  #I #[fg=colour108,bg=colour237] #U #H" setw -g window-status-current-format "#[fg=colour237,bg=colour108]#[fg=colour237,bg=colour108]  #I  #D #[fg=colour237,bg=colour108] #U #H #[fg=colour108,bg=colour237]"

List of plugins

set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'soyuka/tmux-current-pane-hostname'

Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)

run '~/.tmux/plugins/tpm/tpm' `

soyuka commented 6 years ago

try:

set -g @tpm_plugins "                 \
  tmux-plugins/tpm                    \
  soyuka/tmux-current-pane-hostname     \
"
lcorsini commented 6 years ago

already tried, same behaviour #H remains the same and #U is not recognised

soyuka commented 6 years ago

Dunno what I can do to help sorry. You can try to debug the script (it's fairly simple) but as I can't reproduce I'm stuck.

lcorsini commented 6 years ago

Ok I found where the problem is your plugin applies only to status-right and status-left

main() { update_tmux_option "status-right" update_tmux_option "status-left" }

not to window-status-(current)-forrmat I don't know how on osx it get applied there too, but here it won't work outside of status-left or status-right

I tried to add code to apply also on window-status but it doesn't seem possible (maybe I have to play with window title)

hirnschmalz commented 3 years ago

Hi there,

I've the same issue here

I'm working on a current Arch Linux and have the same problem different machines.