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

The shortcut keys set using ohmytmux take effect, but the style is still the default style. #737

Closed
yjcup opened this issue Apr 22, 2024 · 14 comments

Comments

@yjcup
Copy link

yjcup commented Apr 22, 2024

version:

  • Ubuntu22
  • tmux 3.2a
    the output of "cut -c3- ~/.tmux.conf | sh -sx _apply_configuration"
+ :
+ set -e
+ unset GREP_OPTIONS
+ export LC_NUMERIC=C
+ set +H
+ printf
+ sed -E s///
+ uname -s
+ _uname_s=Linux
+ [ -z /tmp/tmux-501/default,2196,0 ]
+ [ -z  ]
+ printf %s /tmp/tmux-501/default,2196,0
+ cut -d, -f1
+ TMUX_SOCKET=/tmp/tmux-501/default
+ [ -z  ]
+ printf %s /tmp/tmux-501/default,2196,0
+ cut -d, -f2
+ TMUX_PID=2196
+ perl -n -e if (s/^n((?:.(?!dylib$|so$))+)$/\1/g) { print; exit } } exit 1; {
+ lsof -b -w -a -d txt -p 2196 -Fn
+ readlink /proc/2196/exe
+ TMUX_PROGRAM=/mnt/rv/[rosetta]
+ [ /mnt/rv/[rosetta] = tmux ]
+ tmux -V
+ awk {gsub(/[^0-9.]/, "", $2); print ($2+0) * 100}
+ /mnt/rv/[rosetta] -S /tmp/tmux-501/default -V
sh: 199: /mnt/rv/[rosetta]: not found
+ _tmux_version=
+ command -v pkill
+ _apply_configuration
+ tmux display -p #{window_active}
+ true
+ window_active=
+ [ -z  ]
+ command -v perl
+ command -v sed
+ command -v awk
+ [  -lt 260 ]
sh: 1687: [: Illegal number:
+ _apply_tmux_256color
+ tmux show -gv default-terminal
+ /mnt/rv/[rosetta] -S /tmp/tmux-501/default show -gv default-terminal
sh: 199: /mnt/rv/[rosetta]: not found
+ command infocmp -x tmux-256color
+ tmux set -g default-terminal tmux-256color
+ /mnt/rv/[rosetta] -S /tmp/tmux-501/default set -g default-terminal tmux-256color
sh: 199: /mnt/rv/[rosetta]: not found
image
@yjcup yjcup closed this as completed Apr 28, 2024
@gpakosz
Copy link
Owner

gpakosz commented Apr 28, 2024

Hello @yjcup 👋

For some reason the detection logic believes that the path to the tmux binary is /mnt/rv/[rosetta].

@gpakosz
Copy link
Owner

gpakosz commented Apr 28, 2024

Are you using Vagrant or Virtualbox on Apple Silicon by chance?

If you don't use Oh my tmux! and you launch a tmux session, then type:

$ readlink "/proc/$(tmux display -p '#{pid}')/exe"

What does it print?

@gpakosz
Copy link
Owner

gpakosz commented Apr 28, 2024

And the output of this command please

$ lsof -b -w -a -d txt -p $(tmux display -p '#{pid}') -Fn

@gpakosz gpakosz reopened this Apr 28, 2024
@yjcup
Copy link
Author

yjcup commented Apr 28, 2024

Are you using Vagrant or Virtualbox on Apple Silicon by chance?

If you don't use Oh my tmux! and you launch a tmux session, then type:

$ readlink "/proc/$(tmux display -p '#{pid}')/exe"

What does it print?

Yes, my computer is an M2 mac, but I use ubuntu22 with x86 architecture on it through docker

yjc@ubuntux86:~$ readlink "/proc/$(tmux display -p '#{pid}')/exe"
/mnt/rv/[rosetta]
yjc@ubuntux86:~$ lsof -b -w -a -d txt -p $(tmux display -p '#{pid}') -Fn
p8932
ftxt
n/mnt/rv/[rosetta]

@gpakosz
Copy link
Owner

gpakosz commented Apr 28, 2024

This is what I believed, this is really broken.

What if you issue

$ ps aux | grep tmux

?

@yjcup
Copy link
Author

yjcup commented Apr 28, 2024

This is what I believed, this is really broken.

What if you issue

$ ps aux | grep tmux

?

yjc@ubuntux86:~$ ps aux | grep tmux
yjc 9301 0.0 0.0 1200328 4224 pts/1 S+ 19:53 0:00 [rosetta] /usr/bin/grep grep --color=auto tmux

@gpakosz
Copy link
Owner

gpakosz commented Apr 28, 2024

I mean when tmux is running 🙂

But in any case I'm much surprised neither readlink nor lsof work

@yjcup
Copy link
Author

yjcup commented Apr 28, 2024

I mean when tmux is running 🙂

But in any case I'm much surprised neither readlink nor lsof work

Okay, I have already configured it through tmux.conf, and it works pretty well now 😊

@gpakosz
Copy link
Owner

gpakosz commented Apr 28, 2024

Okay, I have already configured it through tmux.conf, and it works pretty well now

What do you mean?

@gpakosz
Copy link
Owner

gpakosz commented Apr 29, 2024

If possible,

Could you please undo your changes and see if the gh-737 branch helps?

@yjcup
Copy link
Author

yjcup commented Apr 30, 2024

If possible,

Could you please undo your changes and see if the gh-737 branch helps?

I revoked the previous configuration, and then git clone https://github.com/gpakosz/.tmux.git -b gh-737,

after entering tmux,source ~/.tmux.conf

'TMUX_PROGRAM="$(LSOF=$(PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" command -v lsof[0/0]
SOF -b -w -a -d txt -p 1892 -Fn 2>/dev/null | perl -n -e "if (s/^n((?:.(?!dylib$|so$))+)$/\1/g && s/(?
:\s+\([^\s]+?\))?$//g) { print; exit } } exit 1; {" || readlink "/proc/1892/exe" 2>/dev/null)"; [ -f "
$TMUX_PROGRAM" ] || TMUX_PROGRAM="$(command -v tmux || printf tmux); "$TMUX_PROGRAM" -S /tmp/tmux-501/
default set-environment -g TMUX_PROGRAM "$TMUX_PROGRAM"' returned 2
'"$TMUX_PROGRAM" -S /tmp/tmux-501/default set-environment -g TMUX_SOCKET "/tmp/tmux-501/default"' retu
rned 127
'"$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)' r
eturned 127
'"$TMUX_PROGRAM" set-environment -g TMUX_CONF_LOCAL "$TMUX_CONF.local"' returned 127
'"$TMUX_PROGRAM" source "$TMUX_CONF_LOCAL"' returned 127

@gpakosz
Copy link
Owner

gpakosz commented Apr 30, 2024

I'm sorry I made a typo, I pushed in the gh-737 branch again.

The part I added is [ -f "$TMUX_PROGRAM" ] || TMUX_PROGRAM="$(command -v tmux || printf tmux)".

  • In your case, after having successfully run lsof, TMUX_PROGRAM will be set to mnt/rv/[rosetta]
  • Which will fail the `[ -f "$TMUX_PROGRAM" ] test because that file doesn't exist
  • And in turn TMUX_PROGRAM will be set to the output of command -v tmux
  • And if command -v test, TMUX_PROGRAM will be set to just "tmux"

Could you please try again?

@yjcup
Copy link
Author

yjcup commented Apr 30, 2024

I'm sorry I made a typo, I pushed in the gh-737 branch again.

The part I added is [ -f "$TMUX_PROGRAM" ] || TMUX_PROGRAM="$(command -v tmux || printf tmux)".

  • In your case, after having successfully run lsof, TMUX_PROGRAM will be set to mnt/rv/[rosetta]
  • Which will fail the `[ -f "$TMUX_PROGRAM" ] test because that file doesn't exist
  • And in turn TMUX_PROGRAM will be set to the output of command -v tmux
  • And if command -v test, TMUX_PROGRAM will be set to just "tmux"

Could you please try again?

The configuration is working properly and it feels great👍. Thank you

@gpakosz
Copy link
Owner

gpakosz commented Apr 30, 2024

Thanks so much for testing.
I'll keep this issue open until I merge this workaround

@gpakosz gpakosz closed this as completed in 03c9f40 May 1, 2024
MVMS1994 pushed a commit to MVMS1994/.tmux that referenced this issue May 24, 2024
Mo-tmd pushed a commit to Mo-tmd/.tmux that referenced this issue Aug 14, 2024
Mo-tmd pushed a commit to Mo-tmd/.tmux that referenced this issue Aug 14, 2024
Mo-tmd pushed a commit to Mo-tmd/.tmux that referenced this issue Aug 14, 2024
floatingman pushed a commit to floatingman/.tmux that referenced this issue Sep 30, 2024
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

2 participants