Merge branch 'tmux:master' into feature-floating-window-panes

This commit is contained in:
Michael Grant 2025-10-16 09:35:25 +01:00 committed by GitHub
commit 032af23e18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 40 additions and 4 deletions

View File

@ -18,13 +18,28 @@
#include <glob.h>
#include <unistd.h>
#if defined(HAVE_LIBPROC_H)
#include <libproc.h>
#endif
#include "compat.h"
void fatal(const char *, ...);
void fatalx(const char *, ...);
#ifdef HAVE_PROC_PID
#if defined(HAVE_LIBPROC_H) && defined(HAVE_PROC_PIDINFO)
int
getdtablecount(void)
{
int sz;
pid_t pid = getpid();
sz = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, NULL, 0);
if (sz == -1)
return (0);
return (sz / PROC_PIDLISTFD_SIZE);
}
#elif defined(HAVE_PROC_PID)
int
getdtablecount(void)
{

View File

@ -1369,6 +1369,21 @@ format_cb_buffer_sample(struct format_tree *ft)
return (NULL);
}
/* Callback for buffer_full. */
static void *
format_cb_buffer_full(struct format_tree *ft)
{
size_t size;
const char *s;
if (ft->pb != NULL) {
s = paste_buffer_data(ft->pb, &size);
if (s != NULL)
return (xstrndup(s, size));
}
return (NULL);
}
/* Callback for buffer_size. */
static void *
format_cb_buffer_size(struct format_tree *ft)
@ -3008,6 +3023,9 @@ static const struct format_table_entry format_table[] = {
{ "buffer_created", FORMAT_TABLE_TIME,
format_cb_buffer_created
},
{ "buffer_full", FORMAT_TABLE_STRING,
format_cb_buffer_full
},
{ "buffer_mode_format", FORMAT_TABLE_STRING,
format_cb_buffer_mode_format
},

View File

@ -2657,7 +2657,9 @@ input_exit_apc(struct input_ctx *ictx)
return;
log_debug("%s: \"%s\"", __func__, ictx->input_buf);
if (screen_set_title(sctx->s, ictx->input_buf) && wp != NULL) {
if (wp != NULL &&
options_get_number(wp->options, "allow-set-title") &&
screen_set_title(sctx->s, ictx->input_buf)) {
notify_pane("pane-title-changed", wp);
server_redraw_window_borders(wp->window);
server_status_window(wp->window);

1
tmux.1
View File

@ -6058,6 +6058,7 @@ The following variables are available, where appropriate:
.It Li "alternate_saved_x" Ta "" Ta "Saved cursor X in alternate screen"
.It Li "alternate_saved_y" Ta "" Ta "Saved cursor Y in alternate screen"
.It Li "buffer_created" Ta "" Ta "Time buffer created"
.It Li "buffer_full" Ta "" Ta "Full buffer content"
.It Li "buffer_name" Ta "" Ta "Name of buffer"
.It Li "buffer_sample" Ta "" Ta "Sample of start of buffer"
.It Li "buffer_size" Ta "" Ta "Size of the specified buffer in bytes"

4
tty.c
View File

@ -412,8 +412,8 @@ void
tty_repeat_requests(struct tty *tty, int force)
{
struct client *c = tty->client;
time_t t = time(NULL);
u_int n = t - tty->last_requests;
time_t t = time(NULL);
u_int n = t - tty->last_requests;
if (~tty->flags & TTY_STARTED)
return;