gpakosz / .tmux

🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
MIT License
22.05k stars 3.37k forks source link

Issues after upgrading to tmux 3.5 when using fish shell #761

Closed matallui closed 1 month ago

matallui commented 1 month ago

After upgrading to tmux 3.5 (from 3.4.1), this config stopped working for me. Tmux went back to that classic green lock (like nothing was configured) and the colors were off on vim and everything.

Not sure what happened all of the sudden and haven't found a solution. Just wanted to post here and see if anyone else encountered the same issue

matallui commented 1 month ago

I realized the errors were all coming from this snippet:

%if #{==:#{TMUX_PROGRAM},}
  run 'TMUX_PROGRAM="$(LSOF=$(PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" command -v lsof); $LSOF -b -w -a -d txt -p #{pid} -Fn 2>/dev/null | perl -n -e "if (s/^n((?:.(?!dylib$|so$))+)$/\1/g && s/(?:\s+\([^\s]+?\))?$//g) { print; exit } } exit 1; {" || readlink "/proc/#{pid}/exe" 2>/dev/null)"; { [ -f "$TMUX_PROGRAM" ] && [ -x "$TMUX_PROGRAM" ]; } || TMUX_PROGRAM="$(command -v tmux || printf tmux)"; "$TMUX_PROGRAM" -S #{socket_path} set-environment -g TMUX_PROGRAM "$TMUX_PROGRAM"'
%endif
%if #{==:#{TMUX_SOCKET},}
  run '"$TMUX_PROGRAM" -S #{socket_path} set-environment -g TMUX_SOCKET "#{socket_path}"'
%endif
%if #{==:#{TMUX_CONF},}
  run '"$TMUX_PROGRAM" set-environment -g TMUX_CONF $(for conf in "$HOME/.tmux.conf" "$XDG_CONFIG_HOME/tmux/tmux.conf" "$HOME/.config/tmux/tmux.conf"; do [ -f "$conf" ] && printf "%s" "$conf" && break; done)'
%endif
%if #{==:#{TMUX_CONF_LOCAL},}
  run '"$TMUX_PROGRAM" set-environment -g TMUX_CONF_LOCAL "$TMUX_CONF.local"'
%endif

If I set those env variables in my shell before running tmux, it all worked again.

System:

hanwentao commented 1 month ago

I encountered the same issue. How did you set env variables? @matallui

gpakosz commented 1 month ago

I don't have any issue with macOS, tmux 3.5 and zsh. I need to figure out what changed in tmux

sungkang commented 1 month ago

i had the same issue as @matallui but even after manually setting those env vars, my local tweaks seem to have not taken correctly.

os: macOS 15.0 Sequoia terminal: kitty shell: fish

gpakosz commented 1 month ago

This won't be a so straightforward fix.

In the meantime, explicitly setting TMUX_PROGRAM, TMUX_CONF and TMUX_CONF_LOCAL is the way to go

michael555444 commented 1 month ago

I had the same issue after 3.5 upgrade and all fixed after downgrading (3.5-1 => 3.4-10)

System:

zenodotus280 commented 1 month ago

I had the same issue after 3.5 upgrade and all fixed after downgrading (3.5-1 => 3.4-10)

First time I've ever needed to downgrade after years of using Arch! Here's the command for anyone else looking for a quick fix:

sudo pacman -U https://archive.archlinux.org/packages/t/tmux/tmux-3.4-9-x86_64.pkg.tar.zst

Relevant Arch Wiki List of tmux versions.

gpakosz commented 1 month ago

Can you please try the gh-761 branch?

asrorbek-mannonov commented 1 month ago
'trap '[ -n "$sleep_pid" ] && kill -9 "$sleep_pid"; exit 0' TERM; while [ x"$('/opt/homebrew/Cellar/tmux/3.5/bin/tmux' -S '/private/tmp/tmux-501/default' display -p '#{pid}')" = x"10921" ]; do nice cut -c3- '/Users/<username>/.tmux.
'trap '[ -n "$sleep_pid" ] && kill -9 "$sleep_pid"; exit 0' TERM; while [ x"$('/opt/homebrew/Cellar/tmux/3.5/bin/tmux' -S '/private/tmp/tmux-501/default' display -p '#{pid}')" = x"10921" ]; do nice cut -c3- '/Users/<username>/.tmux.

I got the above warning, but the config is working again. (MacOS Sequoia, wezterm + fish + tmux 3.5)

Can you please try the gh-761 branch?

gpakosz commented 1 month ago

Hmm yeah the fix is still not complete

matallui commented 1 month ago

Adding this to my .config/fish.config was what fixed it for me:

# Fix tmux 3.5 issues
set -gx TMUX_PROGRAM /opt/homebrew/bin/tmux
set -gx TMUX_CONF $HOME/.tmux.conf
set -gx TMUX_CONF_LOCAL $HOME/.tmux.conf.local

cc: @hanwentao @sungkang

sungkang commented 1 month ago

Adding this to my .config/fish.config was what fixed it for me:

# Fix tmux 3.5 issues
set -gx TMUX_PROGRAM /opt/homebrew/bin/tmux
set -gx TMUX_CONF $HOME/.tmux.conf
set -gx TMUX_CONF_LOCAL $HOME/.tmux.conf.local

cc: @hanwentao @sungkang

yup i had that as a temp fix to get it mostly working until the tmux fix is pushed out. I am just waiting for the tmux guys to push out a fix for this soon.

https://github.com/tmux/tmux/issues/4143

@gpakosz has been working with them and seems like they got it resolved.

gpakosz commented 1 month ago

I updated the gh-761 branch

gpakosz commented 1 month ago

Can you please test the most recent version of the gh-761 branch? Commit 3bef43eba9f5ca9cc2a07b961005c78b9b96dcb8.

Thank you

asrorbek-mannonov commented 1 month ago

Can you please test the most recent version of the gh-761 branch? Commit 3bef43eba9f5ca9cc2a07b961005c78b9b96dcb8.

Thank you

branch gh-761 is working fine without issues for me.

gpakosz commented 1 month ago

Things to watch for:

gpakosz commented 1 month ago

All good?!

ank-everstake commented 1 month ago

Pulled gh-761. Seems all is working fine as before, thanks!

XyLyXyRR commented 1 month ago

@gpakosz Unfortunately, this problem does not resolve on my Android phone, but it does resolve on my computer.

Information

fastfetch:

u0_a767@localhost
-----------------
OS: Android REL 12 aarch64
Host: Xiaomi Redmi K30 5G
Kernel: Linux 4.19.113-perf-ga1b60ef832fb
Uptime: 5 days, 18 hours, 54 mins
Packages: 132 (dpkg)
Shell: fish 3.7.1
WM: Window Manager
Terminal: Termux googleplay.2024.08.29
CPU: SM7250 (8) @ 2.40 GHz
Memory: 4.19 GiB / 7.25 GiB (58%)
Swap: 2.16 GiB / 6.00 GiB (36%)
Disk (/): 2.75 GiB / 3.01 GiB (91%) - ext4 [Read-only]
Disk (/storage/emulated): 77.97 GiB / 107.04 GiB (73%) - fuse
Local IP (tun0): 172.19.0.1/30
Local IP (wlan0): 192.168.123.5/24
Locale: en_US.UTF-8

The output is 'sh -c '"$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF"'' returned 127.

If I run tmux in this way: TMUX_PROGRAM=(which tmux) tmux new, it's looks fine.

gpakosz commented 1 month ago

@XyLyXyRR Please make sure you are really using an unmodified version of Oh my tmux! master branch. Then kill all tmux processes and launch it again. If you still have the problem, please open a dedicated issue. Thank you!