mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
3d2686a236
@ -40,7 +40,7 @@ const struct cmd_entry cmd_bind_key_entry = {
|
||||
.usage = "[-cnr] [-t mode-table] [-T key-table] key "
|
||||
"command [arguments]",
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_bind_key_exec
|
||||
};
|
||||
|
||||
|
@ -46,7 +46,7 @@ const struct cmd_entry cmd_capture_pane_entry = {
|
||||
|
||||
.tflag = CMD_PANE,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_capture_pane_exec
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,7 @@ const struct cmd_entry cmd_clear_history_entry = {
|
||||
|
||||
.tflag = CMD_PANE,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_clear_history_exec
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,7 @@ const struct cmd_entry cmd_copy_mode_entry = {
|
||||
|
||||
.tflag = CMD_PANE,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_copy_mode_exec
|
||||
};
|
||||
|
||||
@ -48,7 +48,7 @@ const struct cmd_entry cmd_clock_mode_entry = {
|
||||
|
||||
.tflag = CMD_PANE,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_copy_mode_exec
|
||||
};
|
||||
|
||||
|
@ -41,7 +41,7 @@ const struct cmd_entry cmd_display_panes_entry = {
|
||||
|
||||
.tflag = CMD_CLIENT,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_display_panes_exec
|
||||
};
|
||||
|
||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_list_buffers_entry = {
|
||||
.args = { "F:", 0, 0 },
|
||||
.usage = "[-F format]",
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_list_buffers_exec
|
||||
};
|
||||
|
||||
|
@ -44,7 +44,7 @@ const struct cmd_entry cmd_list_clients_entry = {
|
||||
|
||||
.tflag = CMD_SESSION,
|
||||
|
||||
.flags = CMD_READONLY,
|
||||
.flags = CMD_READONLY|CMD_AFTERHOOK,
|
||||
.exec = cmd_list_clients_exec
|
||||
};
|
||||
|
||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_list_keys_entry = {
|
||||
.args = { "t:T:", 0, 0 },
|
||||
.usage = "[-t mode-table] [-T key-table]",
|
||||
|
||||
.flags = CMD_STARTSERVER,
|
||||
.flags = CMD_STARTSERVER|CMD_AFTERHOOK,
|
||||
.exec = cmd_list_keys_exec
|
||||
};
|
||||
|
||||
@ -50,7 +50,7 @@ const struct cmd_entry cmd_list_commands_entry = {
|
||||
.args = { "F:", 0, 0 },
|
||||
.usage = "[-F format]",
|
||||
|
||||
.flags = CMD_STARTSERVER,
|
||||
.flags = CMD_STARTSERVER|CMD_AFTERHOOK,
|
||||
.exec = cmd_list_keys_exec
|
||||
};
|
||||
|
||||
|
@ -43,7 +43,7 @@ const struct cmd_entry cmd_list_panes_entry = {
|
||||
|
||||
.tflag = CMD_WINDOW,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_list_panes_exec
|
||||
};
|
||||
|
||||
|
@ -45,7 +45,7 @@ const struct cmd_entry cmd_list_sessions_entry = {
|
||||
.args = { "F:", 0, 0 },
|
||||
.usage = "[-F format]",
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_list_sessions_exec
|
||||
};
|
||||
|
||||
|
@ -54,7 +54,7 @@ const struct cmd_entry cmd_list_windows_entry = {
|
||||
|
||||
.tflag = CMD_SESSION,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_list_windows_exec
|
||||
};
|
||||
|
||||
|
@ -42,7 +42,7 @@ const struct cmd_entry cmd_load_buffer_entry = {
|
||||
.args = { "b:", 1, 1 },
|
||||
.usage = CMD_BUFFER_USAGE " path",
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_load_buffer_exec
|
||||
};
|
||||
|
||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_lock_server_entry = {
|
||||
.args = { "", 0, 0 },
|
||||
.usage = "",
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_lock_server_exec
|
||||
};
|
||||
|
||||
@ -46,7 +46,7 @@ const struct cmd_entry cmd_lock_session_entry = {
|
||||
|
||||
.tflag = CMD_SESSION,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_lock_server_exec
|
||||
};
|
||||
|
||||
@ -59,7 +59,7 @@ const struct cmd_entry cmd_lock_client_entry = {
|
||||
|
||||
.tflag = CMD_CLIENT,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_lock_server_exec
|
||||
};
|
||||
|
||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_paste_buffer_entry = {
|
||||
|
||||
.tflag = CMD_PANE,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_paste_buffer_exec
|
||||
};
|
||||
|
||||
|
@ -45,7 +45,7 @@ const struct cmd_entry cmd_pipe_pane_entry = {
|
||||
|
||||
.tflag = CMD_PANE,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_pipe_pane_exec
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,7 @@ const struct cmd_entry cmd_refresh_client_entry = {
|
||||
|
||||
.tflag = CMD_CLIENT,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_refresh_client_exec
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,7 @@ const struct cmd_entry cmd_rename_session_entry = {
|
||||
|
||||
.tflag = CMD_SESSION,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_rename_session_exec
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,7 @@ const struct cmd_entry cmd_rename_window_entry = {
|
||||
|
||||
.tflag = CMD_WINDOW,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_rename_window_exec
|
||||
};
|
||||
|
||||
|
@ -41,7 +41,7 @@ const struct cmd_entry cmd_resize_pane_entry = {
|
||||
|
||||
.tflag = CMD_PANE,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_resize_pane_exec
|
||||
};
|
||||
|
||||
|
@ -40,7 +40,7 @@ const struct cmd_entry cmd_save_buffer_entry = {
|
||||
.args = { "ab:", 1, 1 },
|
||||
.usage = "[-a] " CMD_BUFFER_USAGE " path",
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_save_buffer_exec
|
||||
};
|
||||
|
||||
@ -51,7 +51,7 @@ const struct cmd_entry cmd_show_buffer_entry = {
|
||||
.args = { "b:", 0, 0 },
|
||||
.usage = CMD_BUFFER_USAGE,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_save_buffer_exec
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,7 @@ const struct cmd_entry cmd_select_layout_entry = {
|
||||
|
||||
.tflag = CMD_WINDOW,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_select_layout_exec
|
||||
};
|
||||
|
||||
@ -50,7 +50,7 @@ const struct cmd_entry cmd_next_layout_entry = {
|
||||
|
||||
.tflag = CMD_WINDOW,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_select_layout_exec
|
||||
};
|
||||
|
||||
@ -63,7 +63,7 @@ const struct cmd_entry cmd_previous_layout_entry = {
|
||||
|
||||
.tflag = CMD_WINDOW,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_select_layout_exec
|
||||
};
|
||||
|
||||
|
@ -38,7 +38,7 @@ const struct cmd_entry cmd_send_keys_entry = {
|
||||
|
||||
.tflag = CMD_PANE,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_send_keys_exec
|
||||
};
|
||||
|
||||
@ -51,7 +51,7 @@ const struct cmd_entry cmd_send_prefix_entry = {
|
||||
|
||||
.tflag = CMD_PANE,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_send_keys_exec
|
||||
};
|
||||
|
||||
|
@ -36,7 +36,7 @@ const struct cmd_entry cmd_set_buffer_entry = {
|
||||
.args = { "ab:n:", 0, 1 },
|
||||
.usage = "[-a] " CMD_BUFFER_USAGE " [-n new-buffer-name] data",
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_set_buffer_exec
|
||||
};
|
||||
|
||||
@ -47,7 +47,7 @@ const struct cmd_entry cmd_delete_buffer_entry = {
|
||||
.args = { "b:", 0, 0 },
|
||||
.usage = CMD_BUFFER_USAGE,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_set_buffer_exec
|
||||
};
|
||||
|
||||
|
@ -38,7 +38,7 @@ const struct cmd_entry cmd_set_environment_entry = {
|
||||
|
||||
.tflag = CMD_SESSION_CANFAIL,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_set_environment_exec
|
||||
};
|
||||
|
||||
|
@ -38,7 +38,7 @@ const struct cmd_entry cmd_set_hook_entry = {
|
||||
|
||||
.tflag = CMD_SESSION_CANFAIL,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_set_hook_exec
|
||||
};
|
||||
|
||||
@ -51,7 +51,7 @@ const struct cmd_entry cmd_show_hooks_entry = {
|
||||
|
||||
.tflag = CMD_SESSION,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_set_hook_exec
|
||||
};
|
||||
|
||||
|
@ -73,7 +73,7 @@ const struct cmd_entry cmd_set_option_entry = {
|
||||
|
||||
.tflag = CMD_WINDOW_CANFAIL,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_set_option_exec
|
||||
};
|
||||
|
||||
@ -86,7 +86,7 @@ const struct cmd_entry cmd_set_window_option_entry = {
|
||||
|
||||
.tflag = CMD_WINDOW_CANFAIL,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_set_option_exec
|
||||
};
|
||||
|
||||
|
@ -42,7 +42,7 @@ const struct cmd_entry cmd_show_environment_entry = {
|
||||
|
||||
.tflag = CMD_SESSION_CANFAIL,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_show_environment_exec
|
||||
};
|
||||
|
||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_show_messages_entry = {
|
||||
|
||||
.tflag = CMD_CLIENT,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_show_messages_exec
|
||||
};
|
||||
|
||||
@ -50,7 +50,7 @@ const struct cmd_entry cmd_server_info_entry = {
|
||||
.args = { "", 0, 0 },
|
||||
.usage = "",
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_show_messages_exec
|
||||
};
|
||||
|
||||
|
@ -43,7 +43,7 @@ const struct cmd_entry cmd_show_options_entry = {
|
||||
|
||||
.tflag = CMD_WINDOW_CANFAIL,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_show_options_exec
|
||||
};
|
||||
|
||||
@ -56,7 +56,7 @@ const struct cmd_entry cmd_show_window_options_entry = {
|
||||
|
||||
.tflag = CMD_WINDOW_CANFAIL,
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_show_options_exec
|
||||
};
|
||||
|
||||
|
@ -133,7 +133,8 @@ cmd_string_parse(const char *s, struct cmd_list **cmdlist, const char *file,
|
||||
if (argc == 0)
|
||||
goto out;
|
||||
|
||||
*cmdlist = cmd_list_parse(argc, argv, file, line, cause);
|
||||
*cmdlist = cmd_list_parse(argc, argv, file, line,
|
||||
cause);
|
||||
if (*cmdlist == NULL)
|
||||
goto out;
|
||||
|
||||
|
@ -37,7 +37,7 @@ const struct cmd_entry cmd_unbind_key_entry = {
|
||||
.args = { "ant:T:", 0, 1 },
|
||||
.usage = "[-an] [-t mode-table] [-T key-table] key",
|
||||
|
||||
.flags = 0,
|
||||
.flags = CMD_AFTERHOOK,
|
||||
.exec = cmd_unbind_key_exec
|
||||
};
|
||||
|
||||
|
20
tty.c
20
tty.c
@ -424,7 +424,6 @@ void
|
||||
tty_putc(struct tty *tty, u_char ch)
|
||||
{
|
||||
const char *acs;
|
||||
u_int sx;
|
||||
|
||||
if (tty->cell.attr & GRID_ATTR_CHARSET) {
|
||||
acs = tty_acs_get(tty, ch);
|
||||
@ -436,14 +435,18 @@ tty_putc(struct tty *tty, u_char ch)
|
||||
bufferevent_write(tty->event, &ch, 1);
|
||||
|
||||
if (ch >= 0x20 && ch != 0x7f) {
|
||||
sx = tty->sx;
|
||||
if (tty->term->flags & TERM_EARLYWRAP)
|
||||
sx--;
|
||||
|
||||
if (tty->cx >= sx) {
|
||||
if (tty->cx >= tty->sx) {
|
||||
tty->cx = 1;
|
||||
if (tty->cy != tty->rlower)
|
||||
tty->cy++;
|
||||
|
||||
/*
|
||||
* On !xenl terminals, force the cursor position to
|
||||
* where we think it should be after a line wrap - this
|
||||
* means it works on sensible terminals as well.
|
||||
*/
|
||||
if (tty->term->flags & TERM_EARLYWRAP)
|
||||
tty_putcode2(tty, TTYC_CUP, tty->cy, tty->cx);
|
||||
} else
|
||||
tty->cx++;
|
||||
}
|
||||
@ -1169,8 +1172,9 @@ tty_cell(struct tty *tty, const struct grid_cell *gc,
|
||||
u_int i;
|
||||
|
||||
/* Skip last character if terminal is stupid. */
|
||||
if (tty->term->flags & TERM_EARLYWRAP &&
|
||||
tty->cy == tty->sy - 1 && tty->cx == tty->sx - 1)
|
||||
if ((tty->term->flags & TERM_EARLYWRAP) &&
|
||||
tty->cy == tty->sy - 1 &&
|
||||
tty->cx == tty->sx - 1)
|
||||
return;
|
||||
|
||||
/* If this is a padding character, do nothing. */
|
||||
|
Loading…
Reference in New Issue
Block a user