Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
matallui opened this issue Sep 27, 2024 · 20 comments
Closed

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

matallui opened this issue Sep 27, 2024 · 20 comments

Comments

@matallui
Copy link

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

matallui commented Sep 27, 2024

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:

  • OS: macOS
  • Terminal: Alacritty
  • Shell: fish

@hanwentao
Copy link

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

@gpakosz
Copy link
Owner

gpakosz commented Sep 29, 2024

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

@sungkang
Copy link

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 gpakosz added tmux breakage and removed bug labels Sep 29, 2024
@gpakosz
Copy link
Owner

gpakosz commented Sep 29, 2024

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

@m1cham0v
Copy link

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

System:

  • OS: Arch Linux
  • Architecture: x86_64
  • Kernel version: 6.10.10-arch1-1
  • Terminal: Kitty
  • Shell: fish

@zenodotus280
Copy link

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

gpakosz commented Sep 30, 2024

Can you please try the gh-761 branch?

@asrorbek-mannonov
Copy link

asrorbek-mannonov commented Sep 30, 2024

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

gpakosz commented Sep 30, 2024

Hmm yeah the fix is still not complete

@matallui
Copy link
Author

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

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.

tmux/tmux#4143

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

@gpakosz
Copy link
Owner

gpakosz commented Oct 1, 2024

I updated the gh-761 branch

@gpakosz gpakosz changed the title Issues after upgrading to tmux 3.5 Issues after upgrading to tmux 3.5 when using fish shell Oct 2, 2024
@gpakosz
Copy link
Owner

gpakosz commented Oct 2, 2024

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

Thank you

@asrorbek-mannonov
Copy link

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

gpakosz commented Oct 2, 2024

Things to watch for:

  • Battery status updates correctly
  • Uptime updates correctly
  • Loadavg updates correctly
  • TPM plugins install and work correctly
  • Keeping tmux running shouldn't cause high CPU usage (except what runs in panes)
  • Killing tmux shouldn't leave stray processes behind (ps aux | grep tmux)

@gpakosz
Copy link
Owner

gpakosz commented Oct 3, 2024

All good?!

@ank-everstake
Copy link

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

xymeng16 added a commit to xymeng16/.tmux that referenced this issue Oct 5, 2024
xymeng16 added a commit to xymeng16/dotfiles that referenced this issue Oct 5, 2024
@gpakosz gpakosz closed this as completed in 2c9ef1c Oct 5, 2024
@XyLyXyRR
Copy link

XyLyXyRR commented Oct 7, 2024

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

Information

  • tmux: 3.5a
  • .tmux: 2c9ef1c

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

gpakosz commented Oct 7, 2024

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants