tmux-python / tmuxp

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

tmuxp crashes while load an config file #904

Open 2770862886 opened 7 months ago

2770862886 commented 7 months ago

tmuxp 1.34.0, libtmux 0.25.0

Problem

tmuxp crashes in mac arm64 while load an config file:

Traceback (most recent call last): File "/usr/local/bin/tmuxp", line 8, in sys.exit(cli.cli()) ^^^^^^^^^ File "/opt/homebrew/Cellar/tmuxp/1.34.0/libexec/lib/python3.12/site-packages/tmuxp/cli/init.py", line 132, in cli command_load( File "/opt/homebrew/Cellar/tmuxp/1.34.0/libexec/lib/python3.12/site-packages/tmuxp/cli/load.py", line 649, in command_load load_workspace( File "/opt/homebrew/Cellar/tmuxp/1.34.0/libexec/lib/python3.12/site-packages/tmuxp/cli/load.py", line 460, in load_workspace _load_attached(builder, detached) File "/opt/homebrew/Cellar/tmuxp/1.34.0/libexec/lib/python3.12/site-packages/tmuxp/cli/load.py", line 193, in _load_attached builder.build() File "/opt/homebrew/Cellar/tmuxp/1.34.0/libexec/lib/python3.12/site-packages/tmuxp/workspace/builder.py", line 235, in build session = self.server.new_session( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/tmuxp/1.34.0/libexec/lib/python3.12/site-packages/libtmux/server.py", line 481, in new_session raise exc.LibTmuxException(proc.stderr) libtmux.exc.LibTmuxException: ['no current client']

And with details:

log.txt

with config

session_name: foo
windows:
- layout: main-vertical
  options:
    main-pane-width: 160
  panes:
  - blank
  - blank
  - blank

After exec: tmuxp load foo.yaml it crashes. Any help with be appreciate.

hpauluss commented 5 months ago

I have the same problem, starting about a week ago.

The problem is similar, but I get a different error.

The following call uses the same foo yaml sample:

$ TMUX_CONFIGDIR=$HOME/.tmux.conf tmuxp load tmuxp-foo.yaml
[Loading] /Users/hpa/tmuxp-foo.yaml
Traceback (most recent call last):
  File "/opt/local/bin/tmuxp", line 8, in <module>
    sys.exit(cli.cli())
             ^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tmuxp/cli/__init__.py", line 144, in cli
    command_load(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tmuxp/cli/load.py", line 652, in command_load
    load_workspace(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tmuxp/cli/load.py", line 462, in load_workspace
    _load_attached(builder, detached)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tmuxp/cli/load.py", line 194, in _load_attached
    builder.build()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tmuxp/workspace/builder.py", line 288, in build
    for window, window_config in self.iter_create_windows(session, append):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tmuxp/workspace/builder.py", line 358, in iter_create_windows
    w1 = session.active_window
         ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Session' object has no attribute 'active_window'. Did you mean: 'attached_window'?
tony commented 5 months ago

I can't give this my attention until the evenings / weekend, however: libtmux​ is likely out of sync with tmuxp​.

Make sure you have the latest version of libtmux​ (right now, that's 0.32.0. If you are using 0.25.0, that is way out of date). If you update it, is anything different?

How are you downloading tmuxp? via package manager? pip?

hpauluss commented 5 months ago

Hello,

I'm using the latest version of libtmux:

# port installed | grep libtmux
  py312-libtmux @0.30.2_0 (active)

I use macports package manager on MacOS 14.4.

Maybe a Mac-related problem?

Apart from the tmuxp problems (or libtmux), tmux is working fine.

tony commented 5 months ago

The latest libtmux is 0.32.0, that looks like 0.30.2.

The tmuxp they have with libtmux is out of date.

active_pane is in libtmux 0.31.0+ (https://libtmux.git-pull.com/history.html#libtmux-0-31-0-2024-02-17)

I could create a backward compatible release, but it'd need to be over the weekend. [https://libtmux.git-pull.com/_static/img/icons/icon-192x192.png]https://libtmux.git-pull.com/history.html#libtmux-0-31-0-2024-02-17 Changeloghttps://libtmux.git-pull.com/history.html#libtmux-0-31-0-2024-02-17 For instructions on installing the development version of libtmux, refer to development releases. To install via pip, use: libtmux 0.33.x (Yet to be released): Future release notes will be placed h... libtmux.git-pull.com


From: hpauluss @.> Sent: Thursday, March 14, 2024 3:51 AM To: tmux-python/tmuxp @.> Cc: Tony Narlock @.>; Comment @.> Subject: Re: [tmux-python/tmuxp] tmuxp crashes while load an config file (Issue #904)

Hello,

I'm using the latest version of libtmux:

port installed | grep libtmux

py312-libtmux @0.30.2_0 (active)

I use macports package manager on MacOS 14.4.

Maybe a Mac-related problem?

Apart from the tmuxp problems (or libtmux), tmux is working fine.

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

tony commented 5 months ago

@hpauluss It's late to bring this up, but I didn't realize what you reported has no connection the original post. It looks like you have a macports issue, and it's happening because the libtmux version is out of date with what tmuxp should be using.

You are welcome to make a new issue if you'd like to continue further on the macports issue.

@2770862886 Are you still getting the issue reported with the latest tmuxp / libtmux? I think there may be something in tmux scripts outside of tmuxp that are causing tmux to error. If you use tmuxp -f /dev/null file.yaml, does it still happen?

hpauluss commented 5 months ago

It was indeed a macports issue, which in the meantime has been resolved:

$ tmuxp --version
tmuxp 1.43.0, libtmux 0.35.0