tmux-python / tmuxp

🖥️ Session manager for tmux, build on libtmux.
https://tmuxp.git-pull.com/
MIT License
4.04k stars 231 forks source link

Commands not executing #892

Open iomari opened 9 months ago

iomari commented 9 months ago

Greetings, I recently updated my kubuntu to 23.10 and for some strange reason, when I execute my tmuxp script, the script no longer executes commands written in the script. If you look at the script linked below, you'll see that the script is suppose to execute a few command in certain windows. (mc, ranger, ssh egwfw, weechat). However all I see is the commands on each of the respective terminal command line but not executed. What has changed? I've been using this same script for years now.

https://pastebin.com/1na7PzfM

thanks in advance iomari

tony commented 9 months ago

@iomari Hi! Can you do it without the pastebin? But instead wrap it in this:

<details>

Snippet


</details>

Thank you

tony commented 9 months ago

Also, can you provide these?

iomari commented 9 months ago
``` session_name: '0' shell_command_before: "sudo cp -f /home/iomari/resolv.conf.nimc /etc/resolv.conf " windows: # ----- mc and ranger - layout: 3fff,295x81,0,0{147x81,0,0,1,147x81,148,0,2} options: automatic-rename: 'off' panes: - focus: 'true' shell_command: mc - ranger start_directory: /home/iomari window_name: t1 # ----- terminal 02 - layout: 5de3,295x81,0,0,33 options: automatic-rename: 'off' panes: - focus: 'true' # shell_command: weechat start_directory: /home/iomari window_name: t2 # ----- terminal 03 - layout: 5de3,295x81,0,0,33 options: automatic-rename: 'off' panes: - focus: 'true' # shell_command: weechat start_directory: /home/iomari window_name: t3 # ----- terminal04 - layout: 5de3,295x81,0,0,33 options: automatic-rename: 'off' panes: - focus: 'true' # shell_command: weechat start_directory: /home/iomari window_name: t4 # ----- terminal05 - layout: 5de3,295x81,0,0,33 options: automatic-rename: 'off' panes: - focus: 'true' # shell_command: weechat start_directory: /home/iomari window_name: t5 # ----- terminal06 - layout: 5de3,295x81,0,0,33 options: automatic-rename: 'off' panes: - focus: 'true' # shell_command: xonsh start_directory: /home/iomari window_name: xonsh # ----- firewall tmux ession - layout: 5de3,295x81,0,0,33 options: automatic-rename: 'off' panes: - focus: 'true' shell_command: ssh egwfw start_directory: /home/iomari window_name: t7 # ----- weechat - layout: 5de3,295x81,0,0,33 options: automatic-rename: 'off' panes: - focus: 'true' shell_command: weechat start_directory: /home/iomari window_name: t8 ```

tmux 3.3a

Python 3.11.6

which pip: /home/iomari//.local/bin/pip /home/iomari/.local/bin/pip /home/iomari//.pyenv/shims/pip /usr/local/bin/pip /usr/bin/pip /bin/pip /usr/bin/X11/pip /home/iomari//.local/bin/pip

which tmuxp: /home/iomari//.local/bin/tmuxp /home/iomari/.local/bin/tmuxp /home/iomari//.local/bin/tmuxp

pip show libtmux DEPRECATION: Loading egg at /usr/local/lib/python3.11/dist-packages/scrapyard_backend-2.1.1-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 WARNING: Package(s) not found: libtmux

pip show tmuxp DEPRECATION: Loading egg at /usr/local/lib/python3.11/dist-packages/scrapyard_backend-2.1.1-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 WARNING: Package(s) not found: tmuxp

echo $PATH /home/iomari/.rd/bin:/home/iomari//.local/bin:/home/iomari//.poetry/bin:/home/iomari/.local/bin:/usr/local/go/bin:/home/iomari//.pyenv/shims:/home/iomari//.pyenv/bin:/home/iomari//.npm-global/bin:/home/iomari//.autojump/bin:/snap/bin:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/opt/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/bin/mybin:/opt/anaconda/bin:/home/iomari//bin:/home/iomari//.local/bin:/usr/local/go/bin:/home/iomari//.vim/bundle/start/fzf/bin/:/home/iomari//.cargo/bin:/opt/kafka/bin:/home/iomari/.fzf/bin:/home/iomari/.fzf/bin:/snap/bin:/home/iomari/bin/aliases

echo $SHELL /usr/bin/zsh

tony commented 9 months ago

I can't solve the problem for you, but I think there is an issue with the system's python setup:

I also don't want to give advice - as I don't want to risk complicating your setup more: But in my experience I've cleared out my python setup completely between distribution upgrades. Familiarizing with where user / system python packages are stored would alleviate what data to clear out.

You should see something like this (if you use pip install --user --upgrade tmuxp):

❯ tmuxp -V
tmuxp 1.32.1, libtmux 0.24.1

Note: However, pip install --user --upgrade tmuxp won't be effective if there's old artifacts inside of ~/.local/bin and site-packages.

iomari commented 9 months ago

I've resolved the double slashes. However I think the problem may have something to do with Ubuntu variants don't use pip/pip3 anymore. Instead we have to use pipx which installs in it's own virtual environment then links executables:

ls -la /home/iomari/.local/bin/tmuxp
lrwxrwxrwx 1 iomari iomari 46 Dec  2 12:11 /home/iomari/.local/bin/tmuxp -> /home/iomari/.local/pipx/venvs/tmuxp/bin/tmuxp

I think that's why my tmuxp issue started when I upgrade to 23.10.

tony commented 9 months ago

So to clarify, there is still an issue?

If so, is there any error?

Does pipx reinstall-all​ help? (per herehttps://pipx.pypa.io/stable/troubleshooting/?)

Does this FAQ item "Pipx files not in expected locations according to documentationhttps://pipx.pypa.io/stable/troubleshooting/#pipx-files-not-in-expected-locations-according-to-documentation" apply to you? Does the instructions help? Troubleshooting - pipxhttps://pipx.pypa.io/stable/troubleshooting/#pipx-files-not-in-expected-locations-according-to-documentation execute binaries from Python packages in isolated environments pipx.pypa.io

What if, instead of pipx, you use pip install --user --upgrade tmuxp​ instead​?


From: Ibrahim Salim Omari @.> Sent: Monday, December 4, 2023 10:33 AM To: tmux-python/tmuxp @.> Cc: Tony Narlock @.>; Comment @.> Subject: Re: [tmux-python/tmuxp] Commands not executing (Issue #892)

I've resolved the double slashes. However I think the problem may have something to do with Ubuntu variants don't use pip/pip3 anymore. Instead we have to use pipx which installs in it's own virtual environment then links executables:

ls -la /home/iomari/.local/bin/tmuxp lrwxrwxrwx 1 iomari iomari 46 Dec 2 12:11 /home/iomari/.local/bin/tmuxp -> /home/iomari/.local/pipx/venvs/tmuxp/bin/tmuxp

I think that's why my tmuxp issue started when I upgrade to 23.10.

— Reply to this email directly, view it on GitHubhttps://github.com/tmux-python/tmuxp/issues/892#issuecomment-1839013464, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAAGNYAOSBO2T2WZURJHT7TYHX3MFAVCNFSM6AAAAABAFXG3CWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZZGAYTGNBWGQ. You are receiving this because you commented.Message ID: @.***>

iomari commented 9 months ago

I can no longer use pip in kubuntu23.10. anything I try to install with pip returns:

`pip3 install pycrypto error: externally-managed-environment

× This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification.`