Commit Graph
169 Commits
Author SHA1 Message Date
r1w1s1 f466d6289e compat: use socklen_t for getsockopt length 2026-08-10 15:38:55 -03:00
Nicholas Marriott 2818069d5f Merge pull request #5389 from YayoRazo/fix/prompt-history-getline
fix(compat): drop fgetln compat shim, migrate prompt-history.c to getline
2026-07-13 21:25:10 +01:00
Yayo Razo c3e38b317d fix(compat): drop fgetln compat shim, migrate prompt-history.c to getline
Following up on the comment on #5365 - this drops fgetln from
prompt-history.c (its only remaining caller) in favor of getline, and
removes the fgetln compat shim entirely since nothing references it
anymore: the compat.h declaration, compat/fgetln.c itself, and its
entry in configure.ac's AC_REPLACE_FUNCS list.

fgetln doesn't null-terminate its returned buffer when the final line
in the file lacks a trailing newline, so the old loop had a second
branch to heap-copy and manually terminate that case. getline always
null-terminates regardless, so that branch goes away and the loop
becomes uniform.

Verified with a real build (ubuntu-24.04 container, same
--enable-utf8proc --enable-asan configure CI uses): crafted a history
file with a normal entry, a blank line, and a final entry with no
trailing newline at EOF (the exact case the removed branch existed
for), loaded it through a real ASan-built tmux via show-prompt-history,
all three entries came back correctly. Full regress suite is otherwise
clean against this change.
2026-07-13 13:03:58 -06:00
Yayo Razo 3ff24a8eb4 fix(compat): guard buffer size multiplication in getline 2026-07-11 17:07:21 -06:00
Nicholas Marriott cbe0f1f1e9 Another const from Jere Viikari. 2026-06-14 09:50:50 +01:00
Nicholas Marriott 8a0b4e0d8c Work around systemd killing panes early during system shutdown by creating
dependencies from the panes to the service which started tmux, GitHub issue
4926 from Dmitry Torokhov.
2026-03-18 08:46:16 +00:00
Nicholas Marriott 478eaea982 Update base64 compat. 2026-02-26 10:55:41 +00:00
Nicholas Marriott 356d0aedbd Remove an unused declaration (from OpenBSD, same change also sent by Mike
Jonkmans).
2026-01-04 08:41:38 +00:00
Nicholas Marriott f812b8d304 Cast to avoid warnings on 32-bit architectures. GitHub issue 4597. 2025-10-29 08:49:16 +00:00
Nicholas Marriott 0ff2676a25 Implement getdtablecount(3) for Darwin, from Chip Davis in GitHub issue 4636. 2025-10-06 11:13:53 +01:00
Nicholas Marriott 9f1fac9142 Use MAC_OS_X_VERSION_MIN_REQUIRED. From Sevan Janiyan, GitHub issue 4550. 2025-07-13 07:26:35 +01:00
Nicholas Marriott e7f15d09be Missed a header. 2025-06-24 15:04:24 +01:00
Nicholas Marriott cbb3c4bfed Update imsg from OpenBSD. 2025-06-24 15:02:16 +01:00
Nicholas Marriott 6cc1a607fc optarg should be "extern char *" not "extern const char *". 2025-05-01 07:53:02 +01:00
Nicholas Marriott 1905afb3d8 tmux has its own warnx so there is no need for logit (and this gets rid of a
warning).
2025-04-29 17:39:56 +01:00
Nicholas Marriott f367e3a6c8 Switch to getopt_long from OpenSSH, from Koichi Murase in GitHub issue 4492. 2025-04-28 09:02:15 +01:00
Nicholas Marriott f0a85d0469 Move cgroup dbus requests to the child to avoid a race where a spawned child
that quickly forks will have only the parent process moved to the newly created
cgroup. From Daniel De Graaf, GitHub issue 4435.
2025-04-14 07:27:02 +01:00
Nicholas Marriott 6874ec0dcc Remove endian.h. 2024-11-27 10:31:51 +00:00
Nicholas Marriott 252f41818e Update imsg and remove workaround. 2024-11-27 10:30:52 +00:00
Nicholas Marriott 1365f1ce52 Add an __unused. 2024-11-22 08:07:21 +00:00
Nicholas Marriott 7fc4e54efe And arpa/inet.h needs to stay... 2024-11-22 08:06:30 +00:00
Nicholas Marriott c98c08c232 Need to remove endian.h as well. 2024-11-22 08:05:02 +00:00
Nicholas Marriott 990c724bd8 Bring in updated imsg. 2024-11-22 08:03:55 +00:00
Nicholas Marriott b6d0b4be30 Define SD_ID128_UUID_FORMAT_STR if missing, from Marc Reisner. 2024-11-19 17:55:12 +00:00
Nicholas Marriott 775789fbd5 Rename header guards on compat/queue.h to avoid it conflicting if the system
header is included first. This matters on some platforms (macOS) where queue.h
is old. From Saagar Jha in GitHub issue 4041.
2024-08-04 09:57:26 +01:00
Nicholas Marriott 3823fa2c57 Send SIGHUP since some programs ignore SIGTERM, from Eduardo Grajeda in GitHub
issue 3958.
2024-04-30 12:38:58 +01:00
Nicholas Marriott dd4c0109a9 Missing headers for Android, from Biswapriyo Nath. 2024-04-15 09:07:41 +01:00
Nicholas Marriott f3f1c3db58 Add missing headers, from Marvin Schmidt. 2024-03-06 21:29:28 +00:00
Nicholas Marriott 55d0abad89 Need htonll and ntohll. 2024-01-17 10:57:32 +00:00
Nicholas Marriott 7d91b4b90b htobe is not portable. 2024-01-17 09:47:35 +00:00
Nicholas Marriott 66369416fc Update imsg. 2024-01-17 09:41:53 +00:00
Nicholas Marriott b9524f5b72 Add support for spawning panes in separate cgroups with systemd and a configure
flag to disable. From Eric T Johnson yut23 AT gvljohnsons DOT com in GitHub
issue 3514.
2023-04-03 08:54:06 +01:00
Nicholas Marriott 5ce34add77 Do not attempt to connect to the socket as a client if systemd is active, from
Julien Moutinho in GitHub issue 3345.
2022-10-18 15:58:06 +01:00
Nicholas Marriott 19344ec890 Add headers and fix type, from Marvin Schmidt. GitHub issue 3332. 2022-09-19 07:03:17 +01:00
Nicholas Marriott 19344efa78 Fix fallback implementaion of getpeereid, from Pino Toscano. 2022-08-22 08:21:42 +01:00
Nicholas Marriott be2617036f Remove extra definition of getpeereid. From Eric N Vander Weele in GitHub issue
3209.
2022-06-02 21:45:53 +01:00
Nicholas Marriott 8bcd392ee7 On platforms with no way to get peer UID, use getuid(), also fix some failure
checks.
2022-04-06 16:47:59 +01:00
Nicholas Marriott fc7f1e7acb Add support for systemd socket activation (where systemd creates the Unix
domain socket for tmux rather than tmux creating it). Build with
--enable-systemd. From Julien Moutinho in GitHub issue 3119.
2022-03-28 08:42:13 +01:00
Nicholas Marriott 04952f15df Use getpeerucred if available (not tested). 2022-03-08 11:35:06 +00:00
Nicholas Marriott afd9b68d10 Add getpeerid compat. 2022-03-08 11:02:17 +00:00
Nicholas Marriott 0792b65863 Remove compat.h again. 2021-03-08 08:59:13 +00:00
Nicholas Marriott c01251d023 Merge branch 'master' into 3.2-rc 2021-03-02 12:08:34 +00:00
Nicholas Marriott e3d71d9bdf Add compat clock_gettime for older macOS. GitHub issue 2555. 2021-02-05 11:01:21 +00:00
Nicholas Marriott 681c0d2bfb Include compat.h after system headers, GitHub issue 2492. 2020-12-07 12:13:20 +00:00
Nicholas Marriott 2f1578ef83 Update closefrom from OpenSSH for macOS code which is now needed. 2020-11-20 09:05:32 +00:00
Nicholas Marriott bfdc4373d7 Update closefrom from OpenSSH for macOS code which is now needed. 2020-11-17 17:57:21 +00:00
Nicholas Marriott 72c46aa15e Add support for Haiku, from David Carlier. GitHub issue 2453. 2020-11-09 09:00:41 +00:00
Nicholas Marriott 991d5a9c74 Add compat for getdtablesize, GitHub issue 2406. 2020-10-07 09:39:43 +01:00
Nicholas Marriott 3a1fc7315c Add getline compat. 2020-06-18 21:01:55 +01:00
Nicholas Marriott 5423bf6db8 Missing headers from compat/asprintf.c, from cyyever at outlook dot com. 2019-09-08 21:29:22 +01:00