From 64d82d5988638f8c8f0ea472b3b9eaa62b75d600 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 22 Nov 2024 12:36:13 +0000 Subject: [PATCH 1/2] Document command prompt escape sequence, from Von Welch. --- tmux.1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tmux.1 b/tmux.1 index 1478e29d..5f584acf 100644 --- a/tmux.1 +++ b/tmux.1 @@ -2340,6 +2340,9 @@ will do nothing. The .Fl o flag jumps to the beginning of the command output instead of the shell prompt. +Finding the beginning of command output requires the shell to emit an escape +sequence (\e033]133;C\e033\e\e) to tell tmux where the output begins. +If the shell does not send these escape sequences, these commands do nothing. .Pp Copy commands may take an optional buffer prefix argument which is used to generate the buffer name (the default is @@ -4873,6 +4876,7 @@ section. .Pp .It Ic copy-mode-position-format Ar format Format of the position indicator in copy mode. +.Pp .It Xo Ic mode-keys .Op Ic vi | emacs .Xc From 5fd45b389272baa930bb3a2607abcbecdc660d7a Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 22 Nov 2024 12:58:05 +0000 Subject: [PATCH 2/2] Do not strvis output to terminal from commands. --- cmd-queue.c | 6 +++--- cmd-save-buffer.c | 2 +- tmux.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd-queue.c b/cmd-queue.c index ee1037c4..60d685f8 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -835,9 +835,9 @@ cmdq_guard(struct cmdq_item *item, const char *guard, int flags) /* Show message from command. */ void -cmdq_print_data(struct cmdq_item *item, int parse, struct evbuffer *evb) +cmdq_print_data(struct cmdq_item *item, struct evbuffer *evb) { - server_client_print(item->client, parse, evb); + server_client_print(item->client, 1, evb); } /* Show message from command. */ @@ -855,7 +855,7 @@ cmdq_print(struct cmdq_item *item, const char *fmt, ...) evbuffer_add_vprintf(evb, fmt, ap); va_end(ap); - cmdq_print_data(item, 0, evb); + cmdq_print_data(item, evb); evbuffer_free(evb); } diff --git a/cmd-save-buffer.c b/cmd-save-buffer.c index 2983282d..baaa3467 100644 --- a/cmd-save-buffer.c +++ b/cmd-save-buffer.c @@ -102,7 +102,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmdq_item *item) if (evb == NULL) fatalx("out of memory"); evbuffer_add(evb, bufdata, bufsize); - cmdq_print_data(item, 1, evb); + cmdq_print_data(item, evb); evbuffer_free(evb); return (CMD_RETURN_NORMAL); } diff --git a/tmux.h b/tmux.h index 066c3821..aaa8ad5f 100644 --- a/tmux.h +++ b/tmux.h @@ -2682,7 +2682,7 @@ u_int cmdq_next(struct client *); struct cmdq_item *cmdq_running(struct client *); void cmdq_guard(struct cmdq_item *, const char *, int); void printflike(2, 3) cmdq_print(struct cmdq_item *, const char *, ...); -void cmdq_print_data(struct cmdq_item *, int, struct evbuffer *); +void cmdq_print_data(struct cmdq_item *, struct evbuffer *); void printflike(2, 3) cmdq_error(struct cmdq_item *, const char *, ...); /* cmd-wait-for.c */