Bug 291325 - sysutils/tmux new version throws terminal error when old tmux jobs are active
Summary: sysutils/tmux new version throws terminal error when old tmux jobs are active
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Joseph Mingrone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-01 10:38 UTC by freebsd
Modified: 2025-12-02 09:35 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (jrm)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description freebsd 2025-12-01 10:38:00 UTC
This is about as precise as I'm able to formulate it.. 

After installing tmux-3.6 I found that it threw an "open terminal failed: not a terminal" error on servers that have active tmux jobs running, which were started from the previous version of tmux (tmux-3.5a_1).

Reinstalling the previous version solved the issue. 

This was reproducible on a body of 100+ FreeBSD (14.3) installs. 

No runnning tmux jobs: tmux-3.6 worked just fine.
Already running tmux jobs: tmux-3.6 throws an error and only reinstalling a previous version helped. 

This goes for installs within the same package build in Poudriere where everything is virtually identical -> tmux jobs already running or not was really the only determining factor.
Comment 1 freebsd 2025-12-01 10:42:01 UTC
We are probably looking at an issue with a pre-existing /tmp/tmux-0/default ?
Comment 2 Herbert J. Skuhra 2025-12-01 11:41:43 UTC
https://github.com/tmux/tmux/issues/4699
Comment 3 freebsd 2025-12-01 12:13:37 UTC
Thanks for the update, and since I'm using the word: why isn't this marked in /usr/ports/UPDATING ?
Comment 4 freebsd 2025-12-01 12:24:25 UTC
Also, "Note that it is very important to restart tmux entirely after upgrading."

After upgrading, running tmux sessions cannot be accessed or attached in any way, which is quite problematic. 

There is no way to restart tmux (afaik), so you have to basically kill the pid of the running tmux server (losing active tmux sessions) of of the individual sessions (same effect).

Or have all sessions open while upgrading tmux in another session. But then you have to kill the pane anyway ..

So is there actually any way to perform the upgrade without killing the sessions (before or after, from the outside or from within)?
Comment 5 commit-hook freebsd_committer freebsd_triage 2025-12-01 19:08:44 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=458a737a70fdcd2882396967fcd19d2632400847

commit 458a737a70fdcd2882396967fcd19d2632400847
Author:     Joseph Mingrone <jrm@FreeBSD.org>
AuthorDate: 2025-12-01 18:55:45 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2025-12-01 19:07:36 +0000

    sysutils/tmux: Document requirement to restart tmux after upgrading

    PR:             291325
    Reported by:    freebsd@bengrimm.net
    Sponsored by:   The FreeBSD Foundation

 UPDATING                        | 11 +++++++++++
 sysutils/tmux/Makefile          |  1 +
 sysutils/tmux/pkg-message (new) | 13 +++++++++++++
 3 files changed, 25 insertions(+)
Comment 6 Joseph Mingrone freebsd_committer freebsd_triage 2025-12-01 19:17:42 UTC
I added pkg-message so that after every tmux package upgrade, users will be reminded to restart tmux.  I also added an entry to /usr/ports/UPDATING, as it's particularly important for the 3.6 upgrade, as described in the GitHub issue Herbert shared.

Someone asked a similar question to yours about restarting tmux: https://github.com/tmux/tmux/issues/4699#issuecomment-3592401112. @nicm responded, confirming that `pkill tmux` may be necessary.

Please let me know if this should be reopened.
Comment 7 freebsd 2025-12-02 09:35:56 UTC
For 'posterity', `tmux kill-server` works just fine for that.