mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
414208aab1
@ -217,7 +217,7 @@ args_escape(const char *s)
|
|||||||
return (escaped);
|
return (escaped);
|
||||||
}
|
}
|
||||||
|
|
||||||
flags = VIS_OCTAL|VIS_TAB|VIS_NL;
|
flags = VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL;
|
||||||
if (s[strcspn(s, quoted)] != '\0')
|
if (s[strcspn(s, quoted)] != '\0')
|
||||||
flags |= VIS_DQ;
|
flags |= VIS_DQ;
|
||||||
utf8_stravis(&escaped, s, flags);
|
utf8_stravis(&escaped, s, flags);
|
||||||
|
22
cmd-parse.y
22
cmd-parse.y
@ -58,6 +58,7 @@ struct cmd_parse_state {
|
|||||||
size_t len;
|
size_t len;
|
||||||
size_t off;
|
size_t off;
|
||||||
|
|
||||||
|
int eol;
|
||||||
int eof;
|
int eof;
|
||||||
struct cmd_parse_input *input;
|
struct cmd_parse_input *input;
|
||||||
u_int escapes;
|
u_int escapes;
|
||||||
@ -933,6 +934,10 @@ yylex(void)
|
|||||||
char *token, *cp;
|
char *token, *cp;
|
||||||
int ch, next;
|
int ch, next;
|
||||||
|
|
||||||
|
if (ps->eol)
|
||||||
|
ps->input->line++;
|
||||||
|
ps->eol = 0;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
ch = yylex_getc();
|
ch = yylex_getc();
|
||||||
|
|
||||||
@ -959,7 +964,7 @@ yylex(void)
|
|||||||
/*
|
/*
|
||||||
* End of line. Update the line number.
|
* End of line. Update the line number.
|
||||||
*/
|
*/
|
||||||
ps->input->line++;
|
ps->eol = 1;
|
||||||
return ('\n');
|
return ('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1113,9 +1118,24 @@ yylex_token_escape(char **buf, size_t *len)
|
|||||||
switch (ch) {
|
switch (ch) {
|
||||||
case EOF:
|
case EOF:
|
||||||
return (0);
|
return (0);
|
||||||
|
case 'a':
|
||||||
|
ch = '\a';
|
||||||
|
break;
|
||||||
|
case 'b':
|
||||||
|
ch = '\b';
|
||||||
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
ch = '\033';
|
ch = '\033';
|
||||||
break;
|
break;
|
||||||
|
case 'f':
|
||||||
|
ch = '\f';
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
ch = ' ';
|
||||||
|
break;
|
||||||
|
case 'v':
|
||||||
|
ch = '\v';
|
||||||
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
ch = '\r';
|
ch = '\r';
|
||||||
break;
|
break;
|
||||||
|
28
cmd-queue.c
28
cmd-queue.c
@ -203,16 +203,20 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmd_find_state *current,
|
|||||||
struct cmdq_item *item, *first = NULL, *last = NULL;
|
struct cmdq_item *item, *first = NULL, *last = NULL;
|
||||||
struct cmd *cmd;
|
struct cmd *cmd;
|
||||||
struct cmdq_shared *shared;
|
struct cmdq_shared *shared;
|
||||||
|
u_int group = 0;
|
||||||
shared = xcalloc(1, sizeof *shared);
|
|
||||||
if (current != NULL)
|
|
||||||
cmd_find_copy_state(&shared->current, current);
|
|
||||||
else
|
|
||||||
cmd_find_clear_state(&shared->current, 0);
|
|
||||||
if (m != NULL)
|
|
||||||
memcpy(&shared->mouse, m, sizeof shared->mouse);
|
|
||||||
|
|
||||||
TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
|
TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
|
||||||
|
if (cmd->group != group) {
|
||||||
|
shared = xcalloc(1, sizeof *shared);
|
||||||
|
if (current != NULL)
|
||||||
|
cmd_find_copy_state(&shared->current, current);
|
||||||
|
else
|
||||||
|
cmd_find_clear_state(&shared->current, 0);
|
||||||
|
if (m != NULL)
|
||||||
|
memcpy(&shared->mouse, m, sizeof shared->mouse);
|
||||||
|
group = cmd->group;
|
||||||
|
}
|
||||||
|
|
||||||
item = xcalloc(1, sizeof *item);
|
item = xcalloc(1, sizeof *item);
|
||||||
xasprintf(&item->name, "[%s/%p]", cmd->entry->name, item);
|
xasprintf(&item->name, "[%s/%p]", cmd->entry->name, item);
|
||||||
item->type = CMDQ_COMMAND;
|
item->type = CMDQ_COMMAND;
|
||||||
@ -263,12 +267,20 @@ static enum cmd_retval
|
|||||||
cmdq_fire_command(struct cmdq_item *item)
|
cmdq_fire_command(struct cmdq_item *item)
|
||||||
{
|
{
|
||||||
struct client *c = item->client;
|
struct client *c = item->client;
|
||||||
|
const char *name = cmdq_name(c);
|
||||||
struct cmdq_shared *shared = item->shared;
|
struct cmdq_shared *shared = item->shared;
|
||||||
struct cmd *cmd = item->cmd;
|
struct cmd *cmd = item->cmd;
|
||||||
const struct cmd_entry *entry = cmd->entry;
|
const struct cmd_entry *entry = cmd->entry;
|
||||||
enum cmd_retval retval;
|
enum cmd_retval retval;
|
||||||
struct cmd_find_state *fsp, fs;
|
struct cmd_find_state *fsp, fs;
|
||||||
int flags;
|
int flags;
|
||||||
|
char *tmp;
|
||||||
|
|
||||||
|
if (log_get_level() > 1) {
|
||||||
|
tmp = cmd_print(cmd);
|
||||||
|
log_debug("%s %s: (%u) %s", __func__, name, item->group, tmp);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
|
||||||
flags = !!(shared->flags & CMDQ_SHARED_CONTROL);
|
flags = !!(shared->flags & CMDQ_SHARED_CONTROL);
|
||||||
cmdq_guard(item, "begin", flags);
|
cmdq_guard(item, "begin", flags);
|
||||||
|
@ -691,7 +691,7 @@ tty_term_describe(struct tty_term *term, enum tty_code_code code)
|
|||||||
break;
|
break;
|
||||||
case TTYCODE_STRING:
|
case TTYCODE_STRING:
|
||||||
strnvis(out, term->codes[code].value.string, sizeof out,
|
strnvis(out, term->codes[code].value.string, sizeof out,
|
||||||
VIS_OCTAL|VIS_TAB|VIS_NL);
|
VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL);
|
||||||
xsnprintf(s, sizeof s, "%4u: %s: (string) %s",
|
xsnprintf(s, sizeof s, "%4u: %s: (string) %s",
|
||||||
code, tty_term_codes[code].name,
|
code, tty_term_codes[code].name,
|
||||||
out);
|
out);
|
||||||
|
@ -245,7 +245,7 @@ window_buffer_draw(__unused void *modedata, void *itemdata,
|
|||||||
at = 0;
|
at = 0;
|
||||||
while (end != pdata + psize && *end != '\n') {
|
while (end != pdata + psize && *end != '\n') {
|
||||||
if ((sizeof line) - at > 5) {
|
if ((sizeof line) - at > 5) {
|
||||||
cp = vis(line + at, *end, VIS_TAB|VIS_OCTAL, 0);
|
cp = vis(line + at, *end, VIS_OCTAL|VIS_TAB, 0);
|
||||||
at = cp - line;
|
at = cp - line;
|
||||||
}
|
}
|
||||||
end++;
|
end++;
|
||||||
|
Loading…
Reference in New Issue
Block a user