.tmux: tmux list keys breaking on remote system via ssh

I am running tmux 3.0 on local system and it works fine. Recently, I decided to start setting it up on my remote desktop. I am using exact same config on remote as my local one. Both boxes run on zsh shell.

I am currently on commit a83ba39f09534c2df8f9e94e48174d67be030976.

The code currently returns 1 on following line

tmux list-keys | grep -vF 'tmux.conf.local' | grep -E '(new-window|split(-|_)window|new-session|copy-selection|copy-pipe)' > "$cfg"

contents of $cfg

tmux list-keys | grep -vF 'tmux.conf.local' | grep -E '(new-window|split(-|_)window|new-session|copy-selection|copy-pipe)' > "$cfg"
bind-key    -T copy-mode    C-w                   send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode    MouseDragEnd1Pane     send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode    M-w                   send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode-vi C-j                   send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode-vi Enter                 send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode-vi MouseDragEnd1Pane     send-keys -X copy-selection-and-cancel
bind-key    -T prefix       C-c                   new-session
bind-key    -T prefix       \"                    split-window
bind-key    -T prefix       %                     split-window -h
bind-key    -T prefix       -                     split-window -v
bind-key    -T prefix       c                     new-window
bind-key    -T prefix       |                     split-window -h
bind-key    -T root         MouseDown3Pane        if-shell -F -t = "#{||:#{mouse_any_flag},#{pane_in_mode}}" "select-pane -t=; send-keys -M" "display-menu -t= -xM -yM -T \"#[align=centre]#{pane_index} (#{pane_id})\"  '#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}' 'C-r' {copy-mode -t=; send -Xt= search-backward \"#{q:mouse_word}\"} '#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}' 'C-y' {send-keys -l -- \"#{q:mouse_word}\"} '#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}' 'c' {set-buffer -- \"#{q:mouse_word}\"} '#{?mouse_line,Copy Line,}' 'l' {set-buffer -- \"#{q:mouse_line}\"} '' 'Horizontal Split' 'h' {split-window -h} 'Vertical Split' 'v' {split-window -v} '' 'Swap Up' 'u' {swap-pane -U} 'Swap Down' 'd' {swap-pane -D} '#{?pane_marked_set,,-}Swap Marked' 's' {swap-pane} '' 'Kill' 'X' {kill-pane} 'Respawn' 'R' {respawn-pane -k} '#{?pane_marked,Unmark,Mark}' 'm' {select-pane -m} '#{?window_zoomed_flag,Unzoom,Zoom}' 'z' {resize-pane -Z}"
bind-key    -T root         MouseDown3Status      display-menu -T "#[align=centre]#{window_index}:#{window_name}" -t = -x W -y S "Swap Left" l "swap-window -t:-1" "Swap Right" r "swap-window -t:+1" "#{?pane_marked_set,,-}Swap Marked" s swap-window  Kill X kill-window Respawn R "respawn-window -k" "#{?pane_marked,Unmark,Mark}" m "select-pane -m" Rename n "command-prompt -I \"#W\" \"rename-window -- '%%'\""  "New After" w "new-window -a" "New At End" W new-window
bind-key    -T root         MouseDown3StatusLeft  display-menu -T "#[align=centre]#{session_name}" -t = -x M -y S Next n "switch-client -n" Previous p "switch-client -p"  Renumber N "move-window -r" Rename n "command-prompt -I \"#S\" \"rename-session -- '%%'\""  "New Session" s new-session "New Window" w new-window
bind-key    -T root         M-MouseDown3Pane      display-menu -T "#[align=centre]#{pane_index} (#{pane_id})" -t = -x M -y M "#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}" C-r "copy-mode -t=; send -Xt= search-backward \"#{q:mouse_word}\"" "#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}" C-y "send-keys -l -- \"#{q:mouse_word}\"" "#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}" c "set-buffer -- \"#{q:mouse_word}\"" "#{?mouse_line,Copy Line,}" l "set-buffer -- \"#{q:mouse_line}\""  "Horizontal Split" h "split-window -h" "Vertical Split" v "split-window -v"  "Swap Up" u "swap-pane -U" "Swap Down" d "swap-pane -D" "#{?pane_marked_set,,-}Swap Marked" s swap-pane  Kill X kill-pane Respawn R "respawn-pane -k" "#{?pane_marked,Unmark,Mark}" m "select-pane -m" "#{?window_zoomed_flag,Unzoom,Zoom}" z "resize-pane -Z"

Output of cut -c3- ~/.tmux.conf | sh -sx _apply_configuration

+ cat
+ set -e
+ unset GREP_OPTIONS
+ export LC_NUMERIC=C
+ LC_NUMERIC=C
+ sed -E s///
+ printf ''
+ __newline='
'
+ _apply_configuration
+ command -v perl
+ command -v sed
+ command -v awk
+ command -v reattach-to-user-namespace
+ _apply_overrides
+ tmux_conf_theme_24b_colour=false
+ _is_enabled false
+ '[' xfalse = xenabled ']'
+ '[' xfalse = xtrue ']'
+ '[' xfalse = xyes ']'
+ '[' xfalse = x1 ']'
+ return 1
+ _apply_bindings
++ mktemp
+ cfg=/tmp/tmp.4zgSf0qVfm
+ trap 'rm -f $cfg*' EXIT
+ echo 1
1
+ grep -vF tmux.conf.local
+ grep -E '(new-window|split(-|_)window|new-session|copy-selection|copy-pipe)'
+ tmux list-keys
+ rm -f /tmp/tmp.4zgSf0qVfm

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 30 (16 by maintainers)

Most upvoted comments

@gpakosz Finally I got my hands dirty on this issue. The root cause of this issue is that I built tmux from source and in my .zshrc added an alias tmux=/path/to/my/custom/tmux

Also, in my profile I had

  6 case $- in
  7     *i*) ;;
  8       *) return;;
  9 esac

which is causing sh command in .tmux.conf to not resolve to correct aliases since not interactive shells won’t source my profile. I fixed the issue by pointing to my custom tmux path in .tmux.conf for now.

Appreciate your quick response for this issue.