Skip to content

TmuxObjectDoesNotExist when creating libtmux.Server().new_session(attach=True) #502

Open
@Pipeliner

Description

@Pipeliner
$ python3 -c 'import libtmux ; print(libtmux.Server().new_session(attach=True))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/vadim/.cache/pypoetry/virtualenvs/robots-ml-agent-PwTI9jHQ-py3.8/lib/python3.8/site-packages/libtmux/server.py", line 493, in new_session
    return Session.from_session_id(
  File "/home/vadim/.cache/pypoetry/virtualenvs/robots-ml-agent-PwTI9jHQ-py3.8/lib/python3.8/site-packages/libtmux/session.py", line 85, in from_session_id
    session = fetch_obj(
  File "/home/vadim/.cache/pypoetry/virtualenvs/robots-ml-agent-PwTI9jHQ-py3.8/lib/python3.8/site-packages/libtmux/neo.py", line 240, in fetch_obj
    raise exc.TmuxObjectDoesNotExist(
libtmux.exc.TmuxObjectDoesNotExist: Could not find object

from pyproject.toml:
[tool.poetry.dependencies]
python = "^3.8"
libtmux = {git = "https://github.com/tmux-python/libtmux/"}
tmuxp = "^1.31.0"

$ tmux -V
tmux 3.0a

$ tmuxp -V
tmuxp 1.31.0, libtmux 0.23.2

$ apt-cache policy tmux
tmux:
  Installed: 3.0a-2ubuntu0.4
  Candidate: 3.0a-2ubuntu0.4
  Version table:
 *** 3.0a-2ubuntu0.4 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
        100 /var/lib/dpkg/status
     3.0a-2 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=en_US.utf8

When I run this code, the session is created successfully (tmux opens up, there is a single window with text like $2 in it, closed upon enter, and then I have a shell) but libtmux does not seem to find it.

It's the same with tmux 3.3a from Linuxbrew.
When the session gets started:

tmux list-sessions
0: 1 windows (created Sat Oct 21 02:13:23 2023) (attached)
2: 1 windows (created Sat Oct 21 02:13:48 2023) (attached)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions