mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last
time now I've configured emacs to make them displayed in really annoying colours...
This commit is contained in:
parent
6c9862662f
commit
15a64b805e
6
client.c
6
client.c
@ -143,7 +143,7 @@ client_send_environ(void)
|
||||
struct msg_environ_data data;
|
||||
char **var;
|
||||
|
||||
for (var = environ; *var != NULL; var++) {
|
||||
for (var = environ; *var != NULL; var++) {
|
||||
if (strlcpy(data.var, *var, sizeof data.var) >= sizeof data.var)
|
||||
continue;
|
||||
client_write_server(MSG_ENVIRON, &data, sizeof data);
|
||||
@ -153,7 +153,7 @@ client_send_environ(void)
|
||||
void
|
||||
client_write_server(enum msgtype type, void *buf, size_t len)
|
||||
{
|
||||
imsg_compose(&client_ibuf, type, PROTOCOL_VERSION, -1, -1, buf, len);
|
||||
imsg_compose(&client_ibuf, type, PROTOCOL_VERSION, -1, -1, buf, len);
|
||||
}
|
||||
|
||||
void
|
||||
@ -179,7 +179,7 @@ client_main(void)
|
||||
|
||||
/* Note: event_init() has already been called. */
|
||||
|
||||
/* Set up signals. */
|
||||
/* Set up signals. */
|
||||
memset(&sigact, 0, sizeof sigact);
|
||||
sigemptyset(&sigact.sa_mask);
|
||||
sigact.sa_flags = SA_RESTART;
|
||||
|
8
clock.c
8
clock.c
@ -134,13 +134,13 @@ clock_draw(struct screen_write_ctx *ctx, int colour, int style)
|
||||
for (ptr = tim; *ptr != '\0'; ptr++) {
|
||||
if (*ptr >= '0' && *ptr <= '9')
|
||||
idx = *ptr - '0';
|
||||
else if (*ptr == ':')
|
||||
else if (*ptr == ':')
|
||||
idx = 10;
|
||||
else if (*ptr == 'A')
|
||||
else if (*ptr == 'A')
|
||||
idx = 11;
|
||||
else if (*ptr == 'P')
|
||||
else if (*ptr == 'P')
|
||||
idx = 12;
|
||||
else if (*ptr == 'M')
|
||||
else if (*ptr == 'M')
|
||||
idx = 13;
|
||||
else {
|
||||
x += 6;
|
||||
|
@ -29,7 +29,7 @@ int cmd_attach_session_exec(struct cmd *, struct cmd_ctx *);
|
||||
const struct cmd_entry cmd_attach_session_entry = {
|
||||
"attach-session", "attach",
|
||||
"[-d] " CMD_TARGET_SESSION_USAGE,
|
||||
CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, "d",
|
||||
CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, "d",
|
||||
cmd_target_init,
|
||||
cmd_target_parse,
|
||||
cmd_attach_session_exec,
|
||||
|
@ -64,18 +64,18 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
if (wl->window->active == NULL)
|
||||
wl->window->active = TAILQ_NEXT(wp, entry);
|
||||
}
|
||||
layout_close_pane(wp);
|
||||
layout_close_pane(wp);
|
||||
|
||||
w = wp->window = window_create1(s->sx, s->sy);
|
||||
TAILQ_INSERT_HEAD(&w->panes, wp, entry);
|
||||
w->active = wp;
|
||||
w->name = default_window_name(w);
|
||||
w = wp->window = window_create1(s->sx, s->sy);
|
||||
TAILQ_INSERT_HEAD(&w->panes, wp, entry);
|
||||
w->active = wp;
|
||||
w->name = default_window_name(w);
|
||||
layout_init(w);
|
||||
|
||||
base_idx = options_get_number(&s->options, "base-index");
|
||||
wl = session_attach(s, w, -1 - base_idx, &cause); /* can't fail */
|
||||
if (!cmd_check_flag(data->chflags, 'd'))
|
||||
session_select(s, wl->idx);
|
||||
wl = session_attach(s, w, -1 - base_idx, &cause); /* can't fail */
|
||||
if (!cmd_check_flag(data->chflags, 'd'))
|
||||
session_select(s, wl->idx);
|
||||
|
||||
server_redraw_session(s);
|
||||
server_status_session_group(s);
|
||||
|
@ -119,7 +119,7 @@ cmd_choose_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
window_choose_ready(wl->window->active,
|
||||
cur, cmd_choose_window_callback, cmd_choose_window_free, cdata);
|
||||
|
||||
return (0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -225,9 +225,9 @@ cmd_target_print(struct cmd *self, char *buf, size_t len)
|
||||
off += cmd_print_flags(buf, len, off, data->chflags);
|
||||
if (off < len && data->target != NULL)
|
||||
off += cmd_prarg(buf + off, len - off, " -t ", data->target);
|
||||
if (off < len && data->arg != NULL)
|
||||
if (off < len && data->arg != NULL)
|
||||
off += cmd_prarg(buf + off, len - off, " ", data->arg);
|
||||
if (off < len && data->arg2 != NULL)
|
||||
if (off < len && data->arg2 != NULL)
|
||||
off += cmd_prarg(buf + off, len - off, " ", data->arg2);
|
||||
return (off);
|
||||
}
|
||||
@ -317,9 +317,9 @@ cmd_srcdst_print(struct cmd *self, char *buf, size_t len)
|
||||
off += xsnprintf(buf + off, len - off, " -s %s", data->src);
|
||||
if (off < len && data->dst != NULL)
|
||||
off += xsnprintf(buf + off, len - off, " -t %s", data->dst);
|
||||
if (off < len && data->arg != NULL)
|
||||
if (off < len && data->arg != NULL)
|
||||
off += cmd_prarg(buf + off, len - off, " ", data->arg);
|
||||
if (off < len && data->arg2 != NULL)
|
||||
if (off < len && data->arg2 != NULL)
|
||||
off += cmd_prarg(buf + off, len - off, " ", data->arg2);
|
||||
return (off);
|
||||
}
|
||||
@ -415,9 +415,9 @@ cmd_buffer_print(struct cmd *self, char *buf, size_t len)
|
||||
off += xsnprintf(buf + off, len - off, " -b %d", data->buffer);
|
||||
if (off < len && data->target != NULL)
|
||||
off += cmd_prarg(buf + off, len - off, " -t ", data->target);
|
||||
if (off < len && data->arg != NULL)
|
||||
if (off < len && data->arg != NULL)
|
||||
off += cmd_prarg(buf + off, len - off, " ", data->arg);
|
||||
if (off < len && data->arg2 != NULL)
|
||||
if (off < len && data->arg2 != NULL)
|
||||
off += cmd_prarg(buf + off, len - off, " ", data->arg2);
|
||||
return (off);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ cmd_kill_session_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
{
|
||||
struct cmd_target_data *data = self->data;
|
||||
struct session *s;
|
||||
struct client *c;
|
||||
struct client *c;
|
||||
u_int i;
|
||||
|
||||
if ((s = cmd_find_session(ctx, data->target)) == NULL)
|
||||
|
@ -75,7 +75,7 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
if (used >= sizeof tmp)
|
||||
continue;
|
||||
|
||||
if (!(bd->key & KEYC_PREFIX)) {
|
||||
if (!(bd->key & KEYC_PREFIX)) {
|
||||
used = strlcat(tmp, "(no prefix) ", sizeof tmp);
|
||||
if (used >= sizeof tmp)
|
||||
continue;
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "tmux.h"
|
||||
|
||||
/*
|
||||
* List panes on given window..
|
||||
* List panes on given window.
|
||||
*/
|
||||
|
||||
int cmd_list_panes_exec(struct cmd *, struct cmd_ctx *);
|
||||
|
@ -267,13 +267,13 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
* Set the client to the new session. If a command client exists, it is
|
||||
* taking this session and needs to get MSG_READY and stay around.
|
||||
*/
|
||||
if (!detached) {
|
||||
if (!detached) {
|
||||
if (ctx->cmdclient != NULL) {
|
||||
server_write_client(ctx->cmdclient, MSG_READY, NULL, 0);
|
||||
ctx->cmdclient->session = s;
|
||||
ctx->cmdclient->session = s;
|
||||
server_redraw_client(ctx->cmdclient);
|
||||
} else {
|
||||
ctx->curclient->session = s;
|
||||
ctx->curclient->session = s;
|
||||
server_redraw_client(ctx->curclient);
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
paste_free_index(&s->buffers, data->buffer);
|
||||
}
|
||||
|
||||
return (0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* Add bytes to a buffer but change every '\n' to '\r'. */
|
||||
|
@ -72,7 +72,7 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
wp = TAILQ_FIRST(&w->panes);
|
||||
TAILQ_REMOVE(&w->panes, wp, entry);
|
||||
layout_free(w);
|
||||
window_destroy_panes(w);
|
||||
window_destroy_panes(w);
|
||||
TAILQ_INSERT_HEAD(&w->panes, wp, entry);
|
||||
window_pane_resize(wp, w->sx, w->sy);
|
||||
if (window_pane_spawn(
|
||||
|
@ -52,7 +52,7 @@ cmd_select_layout_init(struct cmd *self, int key)
|
||||
break;
|
||||
case ('2' | KEYC_ESCAPE):
|
||||
data->arg = xstrdup("even-vertical");
|
||||
break;
|
||||
break;
|
||||
case ('3' | KEYC_ESCAPE):
|
||||
data->arg = xstrdup("main-horizontal");
|
||||
break;
|
||||
|
@ -33,7 +33,7 @@ size_t cmd_send_keys_print(struct cmd *, char *, size_t);
|
||||
|
||||
struct cmd_send_keys_data {
|
||||
char *target;
|
||||
u_int nkeys;
|
||||
u_int nkeys;
|
||||
int *keys;
|
||||
};
|
||||
|
||||
|
@ -99,7 +99,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx)
|
||||
}
|
||||
ctx->print(ctx, "%s", "");
|
||||
|
||||
ctx->print(ctx, "Sessions: [%zu/%zu]",
|
||||
ctx->print(ctx, "Sessions: [%zu/%zu]",
|
||||
sizeof (struct grid_cell), sizeof (struct grid_utf8));
|
||||
for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
|
||||
s = ARRAY_ITEM(&sessions, i);
|
||||
@ -148,7 +148,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx)
|
||||
}
|
||||
ctx->print(ctx, "%s", "");
|
||||
|
||||
ctx->print(ctx, "Terminals:");
|
||||
ctx->print(ctx, "Terminals:");
|
||||
SLIST_FOREACH(term, &tty_terms, entry) {
|
||||
ctx->print(ctx, "%s [references=%u, flags=0x%x]:",
|
||||
term->name, term->references, term->flags);
|
||||
@ -180,7 +180,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx)
|
||||
}
|
||||
ctx->print(ctx, "%s", "");
|
||||
|
||||
ctx->print(ctx, "Jobs:");
|
||||
ctx->print(ctx, "Jobs:");
|
||||
SLIST_FOREACH(job, &all_jobs, lentry) {
|
||||
ctx->print(ctx, "%s [fd=%d, pid=%d, status=%d, flags=0x%x]",
|
||||
job->cmd, job->fd, job->pid, job->status, job->flags);
|
||||
|
@ -34,17 +34,17 @@ const char *cmd_set_option_print(
|
||||
void cmd_set_option_string(struct cmd_ctx *,
|
||||
struct options *, const struct set_option_entry *, char *, int);
|
||||
void cmd_set_option_number(struct cmd_ctx *,
|
||||
struct options *, const struct set_option_entry *, char *);
|
||||
struct options *, const struct set_option_entry *, char *);
|
||||
void cmd_set_option_keys(struct cmd_ctx *,
|
||||
struct options *, const struct set_option_entry *, char *);
|
||||
struct options *, const struct set_option_entry *, char *);
|
||||
void cmd_set_option_colour(struct cmd_ctx *,
|
||||
struct options *, const struct set_option_entry *, char *);
|
||||
struct options *, const struct set_option_entry *, char *);
|
||||
void cmd_set_option_attributes(struct cmd_ctx *,
|
||||
struct options *, const struct set_option_entry *, char *);
|
||||
struct options *, const struct set_option_entry *, char *);
|
||||
void cmd_set_option_flag(struct cmd_ctx *,
|
||||
struct options *, const struct set_option_entry *, char *);
|
||||
struct options *, const struct set_option_entry *, char *);
|
||||
void cmd_set_option_choice(struct cmd_ctx *,
|
||||
struct options *, const struct set_option_entry *, char *);
|
||||
struct options *, const struct set_option_entry *, char *);
|
||||
|
||||
const struct cmd_entry cmd_set_option_entry = {
|
||||
"set-option", "set",
|
||||
|
@ -121,7 +121,7 @@ cmd_string_parse(const char *s, struct cmd_list **cmdlist, char **cause)
|
||||
case EOF:
|
||||
case ' ':
|
||||
case '\t':
|
||||
if (have_arg) {
|
||||
if (have_arg) {
|
||||
buf = xrealloc(buf, 1, len + 1);
|
||||
buf[len] = '\0';
|
||||
|
||||
|
4
cmd.c
4
cmd.c
@ -534,7 +534,7 @@ cmd_lookup_session(const char *name, int *ambiguous)
|
||||
sfound = s;
|
||||
}
|
||||
}
|
||||
return (sfound);
|
||||
return (sfound);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -830,7 +830,7 @@ no_colon:
|
||||
|
||||
no_session:
|
||||
if (ambiguous)
|
||||
ctx->error(ctx, "multiple sessions: %s", arg);
|
||||
ctx->error(ctx, "multiple sessions: %s", arg);
|
||||
else
|
||||
ctx->error(ctx, "session not found: %s", arg);
|
||||
if (sessptr != NULL)
|
||||
|
@ -149,7 +149,7 @@ grid_view_insert_lines_region(struct grid *gd, u_int rlower, u_int py, u_int ny)
|
||||
|
||||
ny2 = rlower + 1 - py - ny;
|
||||
grid_move_lines(gd, rlower + 1 - ny2, py, ny2);
|
||||
grid_clear(gd, 0, py + ny2, gd->sx, ny - ny2);
|
||||
grid_clear(gd, 0, py + ny2, gd->sx, ny - ny2);
|
||||
}
|
||||
|
||||
/* Delete lines. */
|
||||
@ -165,7 +165,7 @@ grid_view_delete_lines(struct grid *gd, u_int py, u_int ny)
|
||||
sy = grid_view_y(gd, gd->sy);
|
||||
|
||||
grid_move_lines(gd, py, py + ny, sy - py - ny);
|
||||
grid_clear(gd, 0, sy - ny, gd->sx, py + ny - (sy - ny));
|
||||
grid_clear(gd, 0, sy - ny, gd->sx, py + ny - (sy - ny));
|
||||
}
|
||||
|
||||
/* Delete lines inside scroll region. */
|
||||
@ -182,7 +182,7 @@ grid_view_delete_lines_region(struct grid *gd, u_int rlower, u_int py, u_int ny)
|
||||
|
||||
ny2 = rlower + 1 - py - ny;
|
||||
grid_move_lines(gd, py, py + ny, ny2);
|
||||
grid_clear(gd, 0, py + ny2, gd->sx, ny - ny2);
|
||||
grid_clear(gd, 0, py + ny2, gd->sx, ny - ny2);
|
||||
}
|
||||
|
||||
/* Insert characters. */
|
||||
|
18
grid.c
18
grid.c
@ -170,7 +170,7 @@ grid_collect_history(struct grid *gd)
|
||||
{
|
||||
u_int yy;
|
||||
|
||||
GRID_DEBUG(gd, "");
|
||||
GRID_DEBUG(gd, "");
|
||||
|
||||
if (gd->hsize < gd->hlimit)
|
||||
return;
|
||||
@ -192,7 +192,7 @@ grid_scroll_history(struct grid *gd)
|
||||
{
|
||||
u_int yy;
|
||||
|
||||
GRID_DEBUG(gd, "");
|
||||
GRID_DEBUG(gd, "");
|
||||
|
||||
yy = gd->hsize + gd->sy;
|
||||
gd->linedata = xrealloc(gd->linedata, yy + 1, sizeof *gd->linedata);
|
||||
@ -208,7 +208,7 @@ grid_scroll_history_region(struct grid *gd, u_int upper, u_int lower)
|
||||
struct grid_line *gl_history, *gl_upper, *gl_lower;
|
||||
u_int yy;
|
||||
|
||||
GRID_DEBUG(gd, "upper=%u, lower=%u", upper, lower);
|
||||
GRID_DEBUG(gd, "upper=%u, lower=%u", upper, lower);
|
||||
|
||||
/* Create a space for a new line. */
|
||||
yy = gd->hsize + gd->sy;
|
||||
@ -354,7 +354,7 @@ grid_clear(struct grid *gd, u_int px, u_int py, u_int nx, u_int ny)
|
||||
{
|
||||
u_int xx, yy;
|
||||
|
||||
GRID_DEBUG(gd, "px=%u, py=%u, nx=%u, ny=%u", px, py, nx, ny);
|
||||
GRID_DEBUG(gd, "px=%u, py=%u, nx=%u, ny=%u", px, py, nx, ny);
|
||||
|
||||
if (nx == 0 || ny == 0)
|
||||
return;
|
||||
@ -395,7 +395,7 @@ grid_clear_lines(struct grid *gd, u_int py, u_int ny)
|
||||
struct grid_line *gl;
|
||||
u_int yy;
|
||||
|
||||
GRID_DEBUG(gd, "py=%u, ny=%u", py, ny);
|
||||
GRID_DEBUG(gd, "py=%u, ny=%u", py, ny);
|
||||
|
||||
if (ny == 0)
|
||||
return;
|
||||
@ -421,7 +421,7 @@ grid_move_lines(struct grid *gd, u_int dy, u_int py, u_int ny)
|
||||
{
|
||||
u_int yy;
|
||||
|
||||
GRID_DEBUG(gd, "dy=%u, py=%u, ny=%u", dy, py, ny);
|
||||
GRID_DEBUG(gd, "dy=%u, py=%u, ny=%u", dy, py, ny);
|
||||
|
||||
if (ny == 0 || py == dy)
|
||||
return;
|
||||
@ -460,7 +460,7 @@ grid_move_cells(struct grid *gd, u_int dx, u_int px, u_int py, u_int nx)
|
||||
struct grid_line *gl;
|
||||
u_int xx;
|
||||
|
||||
GRID_DEBUG(gd, "dx=%u, px=%u, py=%u, nx=%u", dx, px, py, nx);
|
||||
GRID_DEBUG(gd, "dx=%u, px=%u, py=%u, nx=%u", dx, px, py, nx);
|
||||
|
||||
if (nx == 0 || px == dx)
|
||||
return;
|
||||
@ -499,8 +499,8 @@ grid_move_cells(struct grid *gd, u_int dx, u_int px, u_int py, u_int nx)
|
||||
char *
|
||||
grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx)
|
||||
{
|
||||
const struct grid_cell *gc;
|
||||
const struct grid_utf8 *gu;
|
||||
const struct grid_cell *gc;
|
||||
const struct grid_utf8 *gu;
|
||||
char *buf;
|
||||
size_t len, off, size;
|
||||
u_int xx;
|
||||
|
8
input.c
8
input.c
@ -230,7 +230,7 @@ input_init(struct window_pane *wp)
|
||||
ictx->string_len = 0;
|
||||
ictx->string_buf = NULL;
|
||||
|
||||
memcpy(&ictx->cell, &grid_default_cell, sizeof ictx->cell);
|
||||
memcpy(&ictx->cell, &grid_default_cell, sizeof ictx->cell);
|
||||
|
||||
memcpy(&ictx->saved_cell, &grid_default_cell, sizeof ictx->saved_cell);
|
||||
ictx->saved_cx = 0;
|
||||
@ -297,7 +297,7 @@ input_state_first(u_char ch, struct input_ctx *ictx)
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (INPUT_C1CONTROL(ch)) {
|
||||
if (INPUT_C1CONTROL(ch)) {
|
||||
ch -= 0x40;
|
||||
if (ch == '[')
|
||||
input_state(ictx, input_state_sequence_first);
|
||||
@ -1284,7 +1284,7 @@ input_handle_sequence_rm(struct input_ctx *ictx)
|
||||
* Turn history back on (so resize can use it) and then
|
||||
* resize back to the current size.
|
||||
*/
|
||||
wp->base.grid->flags |= GRID_HISTORY;
|
||||
wp->base.grid->flags |= GRID_HISTORY;
|
||||
if (sy > wp->saved_grid->sy)
|
||||
screen_resize(s, sx, sy);
|
||||
|
||||
@ -1372,7 +1372,7 @@ input_handle_sequence_sgr(struct input_ctx *ictx)
|
||||
if (ARRAY_LENGTH(&ictx->args) == 0) {
|
||||
attr = gc->attr;
|
||||
memcpy(gc, &grid_default_cell, sizeof *gc);
|
||||
gc->attr |= (attr & GRID_ATTR_CHARSET);
|
||||
gc->attr |= (attr & GRID_ATTR_CHARSET);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -199,7 +199,7 @@ key_bindings_error(struct cmd_ctx *ctx, const char *fmt, ...)
|
||||
va_end(ap);
|
||||
|
||||
*msg = toupper((u_char) *msg);
|
||||
status_message_set(ctx->curclient, "%s", msg);
|
||||
status_message_set(ctx->curclient, "%s", msg);
|
||||
xfree(msg);
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ key_bindings_info(struct cmd_ctx *ctx, const char *fmt, ...)
|
||||
va_end(ap);
|
||||
|
||||
*msg = toupper((u_char) *msg);
|
||||
status_message_set(ctx->curclient, "%s", msg);
|
||||
status_message_set(ctx->curclient, "%s", msg);
|
||||
xfree(msg);
|
||||
}
|
||||
|
||||
|
20
layout-set.c
20
layout-set.c
@ -295,7 +295,7 @@ layout_set_main_h(struct window *w)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Add in the columns. */
|
||||
/* Add in the columns. */
|
||||
layout_make_node(lcrow, LAYOUT_LEFTRIGHT);
|
||||
for (i = 0; i < columns; i++) {
|
||||
/* Create and add a pane cell. */
|
||||
@ -312,11 +312,11 @@ layout_set_main_h(struct window *w)
|
||||
/* Adjust the row to fit the full width if necessary. */
|
||||
if (i == columns)
|
||||
i--;
|
||||
used = ((i + 1) * width) - 1;
|
||||
if (w->sx <= used)
|
||||
continue;
|
||||
lcchild = TAILQ_LAST(&lcrow->cells, layout_cells);
|
||||
layout_resize_adjust(lcchild, LAYOUT_LEFTRIGHT, w->sx - used);
|
||||
used = ((i + 1) * width) - 1;
|
||||
if (w->sx <= used)
|
||||
continue;
|
||||
lcchild = TAILQ_LAST(&lcrow->cells, layout_cells);
|
||||
layout_resize_adjust(lcchild, LAYOUT_LEFTRIGHT, w->sx - used);
|
||||
}
|
||||
|
||||
/* Adjust the last row height to fit if necessary. */
|
||||
@ -422,10 +422,10 @@ layout_set_main_v(struct window *w)
|
||||
if (i == rows)
|
||||
i--;
|
||||
used = ((i + 1) * height) - 1;
|
||||
if (w->sy <= used)
|
||||
continue;
|
||||
lcchild = TAILQ_LAST(&lccolumn->cells, layout_cells);
|
||||
layout_resize_adjust(lcchild, LAYOUT_TOPBOTTOM, w->sy - used);
|
||||
if (w->sy <= used)
|
||||
continue;
|
||||
lcchild = TAILQ_LAST(&lccolumn->cells, layout_cells);
|
||||
layout_resize_adjust(lcchild, LAYOUT_TOPBOTTOM, w->sy - used);
|
||||
}
|
||||
|
||||
/* Adjust the last column width to fit if necessary. */
|
||||
|
2
layout.c
2
layout.c
@ -554,7 +554,7 @@ layout_split_pane(struct window_pane *wp,
|
||||
case LAYOUT_LEFTRIGHT:
|
||||
if (size < 0)
|
||||
size2 = ((sx + 1) / 2) - 1;
|
||||
else
|
||||
else
|
||||
size2 = size;
|
||||
if (size2 < PANE_MINIMUM)
|
||||
size2 = PANE_MINIMUM;
|
||||
|
2
log.c
2
log.c
@ -183,7 +183,7 @@ log_vfatal(const char *msg, va_list ap)
|
||||
log_vwrite(LOG_CRIT, fmt, ap);
|
||||
} else {
|
||||
if (asprintf(&fmt, "fatal: %s", msg) == -1)
|
||||
exit(1);
|
||||
exit(1);
|
||||
log_vwrite(LOG_CRIT, fmt, ap);
|
||||
}
|
||||
free(fmt);
|
||||
|
@ -42,7 +42,7 @@
|
||||
/* Edit keys command strings. */
|
||||
struct mode_key_cmdstr mode_key_cmdstr_edit[] = {
|
||||
{ MODEKEYEDIT_BACKSPACE, "backspace" },
|
||||
{ MODEKEYEDIT_CANCEL, "cancel" },
|
||||
{ MODEKEYEDIT_CANCEL, "cancel" },
|
||||
{ MODEKEYEDIT_COMPLETE, "complete" },
|
||||
{ MODEKEYEDIT_CURSORLEFT, "cursor-left" },
|
||||
{ MODEKEYEDIT_CURSORRIGHT, "cursor-right" },
|
||||
|
@ -728,7 +728,7 @@ screen_write_clearendofline(struct screen_write_ctx *ctx)
|
||||
if (s->cx <= sx - 1)
|
||||
grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1);
|
||||
|
||||
tty_write(tty_cmd_clearendofline, &ttyctx);
|
||||
tty_write(tty_cmd_clearendofline, &ttyctx);
|
||||
}
|
||||
|
||||
/* Clear to start of line from cursor. */
|
||||
@ -863,7 +863,7 @@ screen_write_linefeed(struct screen_write_ctx *ctx, int wrapped)
|
||||
s->cy++;
|
||||
|
||||
ttyctx.num = wrapped;
|
||||
tty_write(tty_cmd_linefeed, &ttyctx);
|
||||
tty_write(tty_cmd_linefeed, &ttyctx);
|
||||
}
|
||||
|
||||
/* Carriage return (cursor to start of line). */
|
||||
|
2
screen.c
2
screen.c
@ -191,7 +191,7 @@ screen_resize_y(struct screen *s, u_int sy)
|
||||
grid_view_delete_lines(gd, 0, available);
|
||||
}
|
||||
s->cy -= needed;
|
||||
}
|
||||
}
|
||||
|
||||
/* Resize line arrays. */
|
||||
gd->linedata = xrealloc(
|
||||
|
@ -36,7 +36,7 @@ void server_client_reset_state(struct client *);
|
||||
int server_client_msg_dispatch(struct client *);
|
||||
void server_client_msg_command(struct client *, struct msg_command_data *);
|
||||
void server_client_msg_identify(
|
||||
struct client *, struct msg_identify_data *, int);
|
||||
struct client *, struct msg_identify_data *, int);
|
||||
void server_client_msg_shell(struct client *);
|
||||
|
||||
void printflike2 server_client_msg_error(struct cmd_ctx *, const char *, ...);
|
||||
|
@ -121,7 +121,7 @@ server_window_check_bell(struct session *s, struct window *w)
|
||||
tty_putcode(&c->tty, TTYC_BEL);
|
||||
continue;
|
||||
}
|
||||
if (c->session->curw->window == w) {
|
||||
if (c->session->curw->window == w) {
|
||||
status_message_set(c, "Bell in current window");
|
||||
continue;
|
||||
}
|
||||
@ -137,7 +137,7 @@ server_window_check_bell(struct session *s, struct window *w)
|
||||
c = ARRAY_ITEM(&clients, i);
|
||||
if (c == NULL || c->session != s)
|
||||
continue;
|
||||
if (c->session->curw->window != w)
|
||||
if (c->session->curw->window != w)
|
||||
continue;
|
||||
if (!visual) {
|
||||
tty_putcode(&c->tty, TTYC_BEL);
|
||||
@ -163,7 +163,7 @@ server_window_check_activity(struct session *s, struct window *w)
|
||||
if (s->curw->window == w)
|
||||
return (0);
|
||||
|
||||
if (!options_get_number(&w->options, "monitor-activity"))
|
||||
if (!options_get_number(&w->options, "monitor-activity"))
|
||||
return (0);
|
||||
|
||||
if (session_alert_has_window(s, w, WINDOW_ACTIVITY))
|
||||
@ -172,7 +172,7 @@ server_window_check_activity(struct session *s, struct window *w)
|
||||
|
||||
if (s->flags & SESSION_UNATTACHED)
|
||||
return (0);
|
||||
if (options_get_number(&s->options, "visual-activity")) {
|
||||
if (options_get_number(&s->options, "visual-activity")) {
|
||||
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
||||
c = ARRAY_ITEM(&clients, i);
|
||||
if (c == NULL || c->session != s)
|
||||
@ -208,12 +208,12 @@ server_window_check_content(
|
||||
|
||||
if ((found = window_pane_search(wp, ptr, NULL)) == NULL)
|
||||
return (0);
|
||||
xfree(found);
|
||||
xfree(found);
|
||||
|
||||
session_alert_add(s, w, WINDOW_CONTENT);
|
||||
if (s->flags & SESSION_UNATTACHED)
|
||||
return (0);
|
||||
if (options_get_number(&s->options, "visual-content")) {
|
||||
if (options_get_number(&s->options, "visual-content")) {
|
||||
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
||||
c = ARRAY_ITEM(&clients, i);
|
||||
if (c == NULL || c->session != s)
|
||||
|
2
server.c
2
server.c
@ -554,7 +554,7 @@ server_lock_server(void)
|
||||
void
|
||||
server_lock_sessions(void)
|
||||
{
|
||||
struct session *s;
|
||||
struct session *s;
|
||||
u_int i;
|
||||
int timeout;
|
||||
time_t t;
|
||||
|
30
status.c
30
status.c
@ -37,9 +37,9 @@ char *status_job(struct client *, char **);
|
||||
void status_job_callback(struct job *);
|
||||
size_t status_width(struct client *, struct winlink *, time_t);
|
||||
char *status_print(
|
||||
struct client *, struct winlink *, time_t, struct grid_cell *);
|
||||
struct client *, struct winlink *, time_t, struct grid_cell *);
|
||||
void status_replace1(struct client *,
|
||||
struct winlink *, char **, char **, char *, size_t, int);
|
||||
struct winlink *, char **, char **, char *, size_t, int);
|
||||
void status_message_callback(int, short, void *);
|
||||
|
||||
void status_prompt_add_history(struct client *);
|
||||
@ -163,7 +163,7 @@ status_redraw(struct client *c)
|
||||
* Figure out how much space we have for the window list. If there
|
||||
* isn't enough space, just show a blank status line.
|
||||
*/
|
||||
needed = 0;
|
||||
needed = 0;
|
||||
if (llen != 0)
|
||||
needed += llen + 1;
|
||||
if (rlen != 0)
|
||||
@ -193,7 +193,7 @@ status_redraw(struct client *c)
|
||||
/* And draw the window list into it. */
|
||||
screen_write_start(&ctx, NULL, &window_list);
|
||||
RB_FOREACH(wl, winlinks, &s->windows) {
|
||||
screen_write_cnputs(&ctx,
|
||||
screen_write_cnputs(&ctx,
|
||||
-1, &wl->status_cell, utf8flag, "%s", wl->status_text);
|
||||
screen_write_putc(&ctx, &stdgc, ' ');
|
||||
}
|
||||
@ -271,7 +271,7 @@ status_redraw(struct client *c)
|
||||
}
|
||||
|
||||
draw:
|
||||
/* Begin drawing. */
|
||||
/* Begin drawing. */
|
||||
screen_write_start(&ctx, NULL, &c->status);
|
||||
|
||||
/* Draw the left string and arrow. */
|
||||
@ -320,7 +320,7 @@ draw:
|
||||
/* Copy the window list. */
|
||||
screen_write_cursormove(&ctx, wloffset, 0);
|
||||
screen_write_copy(&ctx, &window_list, wlstart, 0, wlwidth, 1);
|
||||
screen_free(&window_list);
|
||||
screen_free(&window_list);
|
||||
|
||||
screen_write_stop(&ctx);
|
||||
|
||||
@ -779,7 +779,7 @@ status_prompt_set(struct client *c, const char *msg,
|
||||
void
|
||||
status_prompt_clear(struct client *c)
|
||||
{
|
||||
if (c->prompt_string == NULL)
|
||||
if (c->prompt_string == NULL)
|
||||
return;
|
||||
|
||||
if (c->prompt_freefn != NULL && c->prompt_data != NULL)
|
||||
@ -857,8 +857,8 @@ status_prompt_redraw(struct client *c)
|
||||
screen_write_nputs(
|
||||
&ctx, left, &gc, utf8flag, "%s", c->prompt_buffer + off);
|
||||
|
||||
for (i = len + size; i < c->tty.sx; i++)
|
||||
screen_write_putc(&ctx, &gc, ' ');
|
||||
for (i = len + size; i < c->tty.sx; i++)
|
||||
screen_write_putc(&ctx, &gc, ' ');
|
||||
}
|
||||
|
||||
screen_write_stop(&ctx);
|
||||
@ -949,12 +949,12 @@ status_prompt_key(struct client *c, int key)
|
||||
size -= last - first;
|
||||
|
||||
/* Insert the new word. */
|
||||
size += strlen(s);
|
||||
size += strlen(s);
|
||||
off = first - c->prompt_buffer;
|
||||
c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + 1);
|
||||
c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + 1);
|
||||
first = c->prompt_buffer + off;
|
||||
memmove(first + strlen(s), first, n);
|
||||
memcpy(first, s, strlen(s));
|
||||
memmove(first + strlen(s), first, n);
|
||||
memcpy(first, s, strlen(s));
|
||||
|
||||
c->prompt_index = (first - c->prompt_buffer) + strlen(s);
|
||||
xfree(s);
|
||||
@ -974,7 +974,7 @@ status_prompt_key(struct client *c, int key)
|
||||
c->flags |= CLIENT_STATUS;
|
||||
}
|
||||
break;
|
||||
case MODEKEYEDIT_DELETE:
|
||||
case MODEKEYEDIT_DELETE:
|
||||
if (c->prompt_index != size) {
|
||||
memmove(c->prompt_buffer + c->prompt_index,
|
||||
c->prompt_buffer + c->prompt_index + 1,
|
||||
@ -1056,7 +1056,7 @@ status_prompt_key(struct client *c, int key)
|
||||
c->flags |= CLIENT_STATUS;
|
||||
}
|
||||
break;
|
||||
case MODEKEYEDIT_ENTER:
|
||||
case MODEKEYEDIT_ENTER:
|
||||
if (*c->prompt_buffer != '\0')
|
||||
status_prompt_add_history(c);
|
||||
if (c->prompt_callbackfn(c->prompt_data, c->prompt_buffer) == 0)
|
||||
|
10
tmux.c
10
tmux.c
@ -219,7 +219,7 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
struct cmd_list *cmdlist;
|
||||
struct cmd *cmd;
|
||||
struct cmd *cmd;
|
||||
enum msgtype msg;
|
||||
struct passwd *pw;
|
||||
struct options *so, *wo;
|
||||
@ -311,7 +311,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
environ_init(&global_environ);
|
||||
for (var = environ; *var != NULL; var++)
|
||||
for (var = environ; *var != NULL; var++)
|
||||
environ_put(&global_environ, *var);
|
||||
|
||||
options_init(&global_s_options, NULL);
|
||||
@ -394,10 +394,10 @@ main(int argc, char **argv)
|
||||
options_set_string(wo, "window-status-format", "#I:#W#F");
|
||||
options_set_string(wo, "window-status-current-format", "#I:#W#F");
|
||||
options_set_number(wo, "xterm-keys", 0);
|
||||
options_set_number(wo, "remain-on-exit", 0);
|
||||
options_set_number(wo, "remain-on-exit", 0);
|
||||
options_set_number(wo, "synchronize-panes", 0);
|
||||
|
||||
if (flags & IDENTIFY_UTF8) {
|
||||
if (flags & IDENTIFY_UTF8) {
|
||||
options_set_number(so, "status-utf8", 1);
|
||||
options_set_number(wo, "utf8", 1);
|
||||
} else {
|
||||
@ -490,7 +490,7 @@ main(int argc, char **argv)
|
||||
|
||||
event_init();
|
||||
|
||||
imsg_compose(main_ibuf, msg, PROTOCOL_VERSION, -1, -1, buf, len);
|
||||
imsg_compose(main_ibuf, msg, PROTOCOL_VERSION, -1, -1, buf, len);
|
||||
|
||||
main_set_signals();
|
||||
|
||||
|
126
tmux.h
126
tmux.h
@ -340,9 +340,9 @@ enum tty_code_type {
|
||||
struct tty_code {
|
||||
enum tty_code_type type;
|
||||
union {
|
||||
char *string;
|
||||
int number;
|
||||
int flag;
|
||||
char *string;
|
||||
int number;
|
||||
int flag;
|
||||
} value;
|
||||
};
|
||||
|
||||
@ -404,15 +404,15 @@ struct msg_identify_data {
|
||||
};
|
||||
|
||||
struct msg_lock_data {
|
||||
char cmd[COMMAND_LENGTH];
|
||||
char cmd[COMMAND_LENGTH];
|
||||
};
|
||||
|
||||
struct msg_environ_data {
|
||||
char var[ENVIRON_LENGTH];
|
||||
char var[ENVIRON_LENGTH];
|
||||
};
|
||||
|
||||
struct msg_shell_data {
|
||||
char shell[MAXPATHLEN];
|
||||
char shell[MAXPATHLEN];
|
||||
};
|
||||
|
||||
/* Mode key commands. */
|
||||
@ -511,13 +511,13 @@ SPLAY_HEAD(mode_key_tree, mode_key_binding);
|
||||
|
||||
/* Command to string mapping. */
|
||||
struct mode_key_cmdstr {
|
||||
enum mode_key_cmd cmd;
|
||||
enum mode_key_cmd cmd;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
/* Named mode key table description. */
|
||||
struct mode_key_table {
|
||||
const char *name;
|
||||
const char *name;
|
||||
struct mode_key_cmdstr *cmdstr;
|
||||
struct mode_key_tree *tree;
|
||||
const struct mode_key_entry *table; /* default entries */
|
||||
@ -683,7 +683,7 @@ struct screen_sel {
|
||||
struct screen {
|
||||
char *title;
|
||||
|
||||
struct grid *grid; /* grid data */
|
||||
struct grid *grid; /* grid data */
|
||||
|
||||
u_int cx; /* cursor x */
|
||||
u_int cy; /* cursor y */
|
||||
@ -693,7 +693,7 @@ struct screen {
|
||||
|
||||
int mode;
|
||||
|
||||
bitstr_t *tabs;
|
||||
bitstr_t *tabs;
|
||||
|
||||
struct screen_sel sel;
|
||||
};
|
||||
@ -743,7 +743,7 @@ struct input_ctx {
|
||||
struct utf8_data utf8data;
|
||||
|
||||
u_char intermediate;
|
||||
void *(*state)(u_char, struct input_ctx *);
|
||||
void *(*state)(u_char, struct input_ctx *);
|
||||
|
||||
u_char private;
|
||||
ARRAY_DECL(, struct input_arg) args;
|
||||
@ -762,7 +762,7 @@ struct window_mode {
|
||||
void (*resize)(struct window_pane *, u_int, u_int);
|
||||
void (*key)(struct window_pane *, struct client *, int);
|
||||
void (*mouse)(struct window_pane *,
|
||||
struct client *, struct mouse_event *);
|
||||
struct client *, struct mouse_event *);
|
||||
void (*timer)(struct window_pane *);
|
||||
};
|
||||
|
||||
@ -800,8 +800,8 @@ struct window_pane {
|
||||
struct screen base;
|
||||
|
||||
/* Saved in alternative screen mode. */
|
||||
u_int saved_cx;
|
||||
u_int saved_cy;
|
||||
u_int saved_cx;
|
||||
u_int saved_cy;
|
||||
struct grid *saved_grid;
|
||||
struct grid_cell saved_cell;
|
||||
|
||||
@ -949,7 +949,7 @@ ARRAY_DECL(sessions, struct session *);
|
||||
/* TTY information. */
|
||||
struct tty_key {
|
||||
char ch;
|
||||
int key;
|
||||
int key;
|
||||
|
||||
struct tty_key *left;
|
||||
struct tty_key *right;
|
||||
@ -975,8 +975,8 @@ SLIST_HEAD(tty_terms, tty_term);
|
||||
struct tty {
|
||||
char *path;
|
||||
|
||||
u_int sx;
|
||||
u_int sy;
|
||||
u_int sx;
|
||||
u_int sy;
|
||||
|
||||
u_int cx;
|
||||
u_int cy;
|
||||
@ -994,7 +994,7 @@ struct tty {
|
||||
|
||||
int log_fd;
|
||||
|
||||
struct termios tio;
|
||||
struct termios tio;
|
||||
|
||||
struct grid_cell cell;
|
||||
|
||||
@ -1006,7 +1006,7 @@ struct tty {
|
||||
#define TTY_UTF8 0x8
|
||||
#define TTY_STARTED 0x10
|
||||
#define TTY_OPENED 0x20
|
||||
int flags;
|
||||
int flags;
|
||||
|
||||
int term_flags;
|
||||
|
||||
@ -1069,7 +1069,7 @@ struct client {
|
||||
char *title;
|
||||
char *cwd;
|
||||
|
||||
struct tty tty;
|
||||
struct tty tty;
|
||||
struct event repeat_timer;
|
||||
|
||||
struct timeval status_timer;
|
||||
@ -1146,7 +1146,7 @@ struct cmd_ctx {
|
||||
|
||||
struct cmd {
|
||||
const struct cmd_entry *entry;
|
||||
void *data;
|
||||
void *data;
|
||||
|
||||
TAILQ_ENTRY(cmd) qentry;
|
||||
};
|
||||
@ -1172,7 +1172,7 @@ struct cmd_entry {
|
||||
int (*parse)(struct cmd *, int, char **, char **);
|
||||
int (*exec)(struct cmd *, struct cmd_ctx *);
|
||||
void (*free)(struct cmd *);
|
||||
size_t (*print)(struct cmd *, char *, size_t);
|
||||
size_t (*print)(struct cmd *, char *, size_t);
|
||||
};
|
||||
|
||||
/* Generic command data. */
|
||||
@ -1242,7 +1242,7 @@ extern char *cfg_file;
|
||||
extern int debug_level;
|
||||
extern int be_quiet;
|
||||
extern time_t start_time;
|
||||
extern char *socket_path;
|
||||
extern char *socket_path;
|
||||
extern int login_shell;
|
||||
void logfile(const char *);
|
||||
const char *getshell(void);
|
||||
@ -1278,13 +1278,13 @@ struct options_entry *options_find1(struct options *, const char *);
|
||||
struct options_entry *options_find(struct options *, const char *);
|
||||
void options_remove(struct options *, const char *);
|
||||
struct options_entry *printflike3 options_set_string(
|
||||
struct options *, const char *, const char *, ...);
|
||||
struct options *, const char *, const char *, ...);
|
||||
char *options_get_string(struct options *, const char *);
|
||||
struct options_entry *options_set_number(
|
||||
struct options *, const char *, long long);
|
||||
struct options *, const char *, long long);
|
||||
long long options_get_number(struct options *, const char *);
|
||||
struct options_entry *options_set_data(
|
||||
struct options *, const char *, void *, void (*)(void *));
|
||||
struct options *, const char *, void *, void (*)(void *));
|
||||
void *options_get_data(struct options *, const char *);
|
||||
|
||||
/* job.c */
|
||||
@ -1312,7 +1312,7 @@ struct environ_entry *environ_find(struct environ *, const char *);
|
||||
void environ_set(struct environ *, const char *, const char *);
|
||||
void environ_put(struct environ *, const char *);
|
||||
void environ_unset(struct environ *, const char *);
|
||||
void environ_update(const char *, struct environ *, struct environ *);
|
||||
void environ_update(const char *, struct environ *, struct environ *);
|
||||
|
||||
/* tty.c */
|
||||
void tty_raw(struct tty *, const char *);
|
||||
@ -1361,12 +1361,12 @@ void tty_cmd_reverseindex(struct tty *, const struct tty_ctx *);
|
||||
extern struct tty_terms tty_terms;
|
||||
extern struct tty_term_code_entry tty_term_codes[NTTYCODE];
|
||||
struct tty_term *tty_term_find(char *, int, const char *, char **);
|
||||
void tty_term_free(struct tty_term *);
|
||||
void tty_term_free(struct tty_term *);
|
||||
int tty_term_has(struct tty_term *, enum tty_code_code);
|
||||
const char *tty_term_string(struct tty_term *, enum tty_code_code);
|
||||
const char *tty_term_string1(struct tty_term *, enum tty_code_code, int);
|
||||
const char *tty_term_string2(
|
||||
struct tty_term *, enum tty_code_code, int, int);
|
||||
struct tty_term *, enum tty_code_code, int, int);
|
||||
int tty_term_number(struct tty_term *, enum tty_code_code);
|
||||
int tty_term_flag(struct tty_term *, enum tty_code_code);
|
||||
|
||||
@ -1381,7 +1381,7 @@ void paste_free_stack(struct paste_stack *);
|
||||
struct paste_buffer *paste_walk_stack(struct paste_stack *, uint *);
|
||||
struct paste_buffer *paste_get_top(struct paste_stack *);
|
||||
struct paste_buffer *paste_get_index(struct paste_stack *, u_int);
|
||||
int paste_free_top(struct paste_stack *);
|
||||
int paste_free_top(struct paste_stack *);
|
||||
int paste_free_index(struct paste_stack *, u_int);
|
||||
void paste_add(struct paste_stack *, char *, size_t, u_int);
|
||||
int paste_replace(struct paste_stack *, u_int, char *, size_t);
|
||||
@ -1393,7 +1393,7 @@ void clock_draw(struct screen_write_ctx *, int, int);
|
||||
/* cmd-set-option.c */
|
||||
extern const struct set_option_entry set_session_option_table[];
|
||||
extern const struct set_option_entry set_window_option_table[];
|
||||
const char *cmd_set_option_print(
|
||||
const char *cmd_set_option_print(
|
||||
const struct set_option_entry *, struct options_entry *);
|
||||
|
||||
/* cmd.c */
|
||||
@ -1508,7 +1508,7 @@ size_t cmd_list_print(struct cmd_list *, char *, size_t);
|
||||
int cmd_string_parse(const char *, struct cmd_list **, char **);
|
||||
|
||||
/* cmd-generic.c */
|
||||
size_t cmd_prarg(char *, size_t, const char *, char *);
|
||||
size_t cmd_prarg(char *, size_t, const char *, char *);
|
||||
int cmd_check_flag(uint64_t, int);
|
||||
void cmd_set_flag(uint64_t *, int);
|
||||
#define CMD_TARGET_PANE_USAGE "[-t target-pane]"
|
||||
@ -1580,9 +1580,9 @@ void server_window_loop(void);
|
||||
void server_fill_environ(struct session *, struct environ *);
|
||||
void server_write_error(struct client *, const char *);
|
||||
void server_write_client(
|
||||
struct client *, enum msgtype, const void *, size_t);
|
||||
struct client *, enum msgtype, const void *, size_t);
|
||||
void server_write_session(
|
||||
struct session *, enum msgtype, const void *, size_t);
|
||||
struct session *, enum msgtype, const void *, size_t);
|
||||
void server_redraw_client(struct client *);
|
||||
void server_status_client(struct client *);
|
||||
void server_redraw_session(struct session *);
|
||||
@ -1609,12 +1609,12 @@ void server_update_event(struct client *);
|
||||
/* status.c */
|
||||
int status_redraw(struct client *);
|
||||
char *status_replace(
|
||||
struct client *, struct winlink *, const char *, time_t, int);
|
||||
struct client *, struct winlink *, const char *, time_t, int);
|
||||
void printflike2 status_message_set(struct client *, const char *, ...);
|
||||
void status_message_clear(struct client *);
|
||||
int status_message_redraw(struct client *);
|
||||
void status_prompt_set(struct client *, const char *,
|
||||
int (*)(void *, const char *), void (*)(void *), void *, int);
|
||||
int (*)(void *, const char *), void (*)(void *), void *, int);
|
||||
void status_prompt_clear(struct client *);
|
||||
int status_prompt_redraw(struct client *);
|
||||
void status_prompt_key(struct client *, int);
|
||||
@ -1633,7 +1633,7 @@ void input_key(struct window_pane *, int);
|
||||
void input_mouse(struct window_pane *, struct mouse_event *);
|
||||
|
||||
/* xterm-keys.c */
|
||||
char *xterm_keys_lookup(int);
|
||||
char *xterm_keys_lookup(int);
|
||||
int xterm_keys_find(const char *, size_t, size_t *, int *);
|
||||
|
||||
/* colour.c */
|
||||
@ -1670,7 +1670,7 @@ void grid_move_lines(struct grid *, u_int, u_int, u_int);
|
||||
void grid_move_cells(struct grid *, u_int, u_int, u_int, u_int);
|
||||
char *grid_string_cells(struct grid *, u_int, u_int, u_int);
|
||||
void grid_duplicate_lines(
|
||||
struct grid *, u_int, struct grid *, u_int, u_int);
|
||||
struct grid *, u_int, struct grid *, u_int, u_int);
|
||||
|
||||
/* grid-utf8.c */
|
||||
size_t grid_utf8_size(const struct grid_utf8 *);
|
||||
@ -1683,11 +1683,11 @@ int grid_utf8_compare(const struct grid_utf8 *, const struct grid_utf8 *);
|
||||
const struct grid_cell *grid_view_peek_cell(struct grid *, u_int, u_int);
|
||||
struct grid_cell *grid_view_get_cell(struct grid *, u_int, u_int);
|
||||
void grid_view_set_cell(
|
||||
struct grid *, u_int, u_int, const struct grid_cell *);
|
||||
struct grid *, u_int, u_int, const struct grid_cell *);
|
||||
const struct grid_utf8 *grid_view_peek_utf8(struct grid *, u_int, u_int);
|
||||
struct grid_utf8 *grid_view_get_utf8(struct grid *, u_int, u_int);
|
||||
void grid_view_set_utf8(
|
||||
struct grid *, u_int, u_int, const struct grid_utf8 *);
|
||||
struct grid *, u_int, u_int, const struct grid_utf8 *);
|
||||
void grid_view_clear(struct grid *, u_int, u_int, u_int, u_int);
|
||||
void grid_view_scroll_region_up(struct grid *, u_int, u_int);
|
||||
void grid_view_scroll_region_down(struct grid *, u_int, u_int);
|
||||
@ -1701,22 +1701,22 @@ char *grid_view_string_cells(struct grid *, u_int, u_int, u_int);
|
||||
|
||||
/* screen-write.c */
|
||||
void screen_write_start(
|
||||
struct screen_write_ctx *, struct window_pane *, struct screen *);
|
||||
struct screen_write_ctx *, struct window_pane *, struct screen *);
|
||||
void screen_write_stop(struct screen_write_ctx *);
|
||||
size_t printflike2 screen_write_cstrlen(int, const char *, ...);
|
||||
void printflike5 screen_write_cnputs(struct screen_write_ctx *,
|
||||
ssize_t, struct grid_cell *, int, const char *, ...);
|
||||
ssize_t, struct grid_cell *, int, const char *, ...);
|
||||
size_t printflike2 screen_write_strlen(int, const char *, ...);
|
||||
void printflike3 screen_write_puts(struct screen_write_ctx *,
|
||||
struct grid_cell *, const char *, ...);
|
||||
struct grid_cell *, const char *, ...);
|
||||
void printflike5 screen_write_nputs(struct screen_write_ctx *,
|
||||
ssize_t, struct grid_cell *, int, const char *, ...);
|
||||
ssize_t, struct grid_cell *, int, const char *, ...);
|
||||
void screen_write_vnputs(struct screen_write_ctx *,
|
||||
ssize_t, struct grid_cell *, int, const char *, va_list);
|
||||
void screen_write_parsestyle(
|
||||
struct grid_cell *, struct grid_cell *, const char *);
|
||||
struct grid_cell *, struct grid_cell *, const char *);
|
||||
void screen_write_putc(
|
||||
struct screen_write_ctx *, struct grid_cell *, u_char);
|
||||
struct screen_write_ctx *, struct grid_cell *, u_char);
|
||||
void screen_write_copy(struct screen_write_ctx *,
|
||||
struct screen *, u_int, u_int, u_int, u_int);
|
||||
void screen_write_backspace(struct screen_write_ctx *);
|
||||
@ -1747,7 +1747,7 @@ void screen_write_clearendofscreen(struct screen_write_ctx *);
|
||||
void screen_write_clearstartofscreen(struct screen_write_ctx *);
|
||||
void screen_write_clearscreen(struct screen_write_ctx *);
|
||||
void screen_write_cell(struct screen_write_ctx *,
|
||||
const struct grid_cell *, const struct utf8_data *);
|
||||
const struct grid_cell *, const struct utf8_data *);
|
||||
|
||||
/* screen-redraw.c */
|
||||
void screen_redraw_screen(struct client *, int);
|
||||
@ -1772,7 +1772,7 @@ int winlink_cmp(struct winlink *, struct winlink *);
|
||||
RB_PROTOTYPE(windows, window, entry, window_cmp);
|
||||
RB_PROTOTYPE(winlinks, winlink, entry, winlink_cmp);
|
||||
struct winlink *winlink_find_by_index(struct winlinks *, int);
|
||||
struct winlink *winlink_find_by_window(struct winlinks *, struct window *);
|
||||
struct winlink *winlink_find_by_window(struct winlinks *, struct window *);
|
||||
int winlink_next_index(struct winlinks *, int);
|
||||
u_int winlink_count(struct winlinks *);
|
||||
struct winlink *winlink_add(struct winlinks *, struct window *, int);
|
||||
@ -1781,11 +1781,11 @@ struct winlink *winlink_next(struct winlink *);
|
||||
struct winlink *winlink_previous(struct winlink *);
|
||||
void winlink_stack_push(struct winlink_stack *, struct winlink *);
|
||||
void winlink_stack_remove(struct winlink_stack *, struct winlink *);
|
||||
int window_index(struct window *, u_int *);
|
||||
int window_index(struct window *, u_int *);
|
||||
struct window *window_create1(u_int, u_int);
|
||||
struct window *window_create(const char *, const char *, const char *,
|
||||
const char *, struct environ *, struct termios *,
|
||||
u_int, u_int, u_int, char **);
|
||||
u_int, u_int, u_int, char **);
|
||||
void window_destroy(struct window *);
|
||||
void window_set_active_at(struct window *, u_int, u_int);
|
||||
void window_set_active_pane(struct window *, struct window_pane *);
|
||||
@ -1808,10 +1808,10 @@ void window_pane_reset_mode(struct window_pane *);
|
||||
void window_pane_parse(struct window_pane *);
|
||||
void window_pane_key(struct window_pane *, struct client *, int);
|
||||
void window_pane_mouse(struct window_pane *,
|
||||
struct client *, struct mouse_event *);
|
||||
struct client *, struct mouse_event *);
|
||||
int window_pane_visible(struct window_pane *);
|
||||
char *window_pane_search(
|
||||
struct window_pane *, const char *, u_int *);
|
||||
struct window_pane *, const char *, u_int *);
|
||||
|
||||
/* layout.c */
|
||||
struct layout_cell *layout_create_cell(struct layout_cell *);
|
||||
@ -1831,7 +1831,7 @@ void layout_init(struct window *);
|
||||
void layout_free(struct window *);
|
||||
void layout_resize(struct window *, u_int, u_int);
|
||||
void layout_resize_pane(
|
||||
struct window_pane *, enum layout_type, int);
|
||||
struct window_pane *, enum layout_type, int);
|
||||
int layout_split_pane(struct window_pane *,
|
||||
enum layout_type, int, struct window_pane *);
|
||||
void layout_close_pane(struct window_pane *);
|
||||
@ -1849,24 +1849,24 @@ extern const struct window_mode window_clock_mode;
|
||||
|
||||
/* window-copy.c */
|
||||
extern const struct window_mode window_copy_mode;
|
||||
void window_copy_pageup(struct window_pane *);
|
||||
void window_copy_pageup(struct window_pane *);
|
||||
|
||||
/* window-more.c */
|
||||
extern const struct window_mode window_more_mode;
|
||||
void window_more_vadd(struct window_pane *, const char *, va_list);
|
||||
void window_more_vadd(struct window_pane *, const char *, va_list);
|
||||
|
||||
/* window-choose.c */
|
||||
extern const struct window_mode window_choose_mode;
|
||||
void window_choose_vadd(
|
||||
struct window_pane *, int, const char *, va_list);
|
||||
void window_choose_vadd(
|
||||
struct window_pane *, int, const char *, va_list);
|
||||
void printflike3 window_choose_add(
|
||||
struct window_pane *, int, const char *, ...);
|
||||
struct window_pane *, int, const char *, ...);
|
||||
void window_choose_ready(struct window_pane *,
|
||||
u_int, void (*)(void *, int), void (*)(void *), void *);
|
||||
|
||||
/* names.c */
|
||||
void queue_window_name(struct window *);
|
||||
char *default_window_name(struct window *);
|
||||
char *default_window_name(struct window *);
|
||||
|
||||
/* session.c */
|
||||
extern struct sessions sessions;
|
||||
@ -1880,12 +1880,12 @@ struct session *session_find(const char *);
|
||||
struct session *session_create(const char *, const char *, const char *,
|
||||
struct environ *, struct termios *, int, u_int, u_int,
|
||||
char **);
|
||||
void session_destroy(struct session *);
|
||||
int session_index(struct session *, u_int *);
|
||||
void session_destroy(struct session *);
|
||||
int session_index(struct session *, u_int *);
|
||||
struct winlink *session_new(struct session *,
|
||||
const char *, const char *, const char *, int, char **);
|
||||
const char *, const char *, const char *, int, char **);
|
||||
struct winlink *session_attach(
|
||||
struct session *, struct window *, int, char **);
|
||||
struct session *, struct window *, int, char **);
|
||||
int session_detach(struct session *, struct winlink *);
|
||||
int session_has(struct session *, struct window *);
|
||||
int session_next(struct session *, int);
|
||||
|
@ -35,7 +35,7 @@ void tty_keys_add1(struct tty_key **, const char *, int);
|
||||
void tty_keys_add(struct tty *, const char *, int);
|
||||
void tty_keys_free1(struct tty_key *);
|
||||
struct tty_key *tty_keys_find1(
|
||||
struct tty_key *, const char *, size_t, size_t *);
|
||||
struct tty_key *, const char *, size_t, size_t *);
|
||||
struct tty_key *tty_keys_find(struct tty *, const char *, size_t, size_t *);
|
||||
void tty_keys_callback(int, short, void *);
|
||||
int tty_keys_mouse(
|
||||
@ -548,7 +548,7 @@ found_key:
|
||||
goto handle_key;
|
||||
|
||||
handle_key:
|
||||
evtimer_del(&tty->key_timer);
|
||||
evtimer_del(&tty->key_timer);
|
||||
|
||||
tty->key_callback(key, &mouse, tty->key_data);
|
||||
|
||||
|
@ -239,7 +239,7 @@ tty_term_override(struct tty_term *term, const char *overrides)
|
||||
|
||||
val = NULL;
|
||||
removeflag = 0;
|
||||
if ((ptr = strchr(entstr, '=')) != NULL) {
|
||||
if ((ptr = strchr(entstr, '=')) != NULL) {
|
||||
*ptr++ = '\0';
|
||||
val = xstrdup(ptr);
|
||||
if (strunvis(val, ptr) == -1) {
|
||||
@ -321,10 +321,12 @@ tty_term_find(char *name, int fd, const char *overrides, char **cause)
|
||||
if (setupterm(name, fd, &error) != OK) {
|
||||
switch (error) {
|
||||
case 1:
|
||||
xasprintf(cause, "can't use hardcopy terminal: %s", name);
|
||||
xasprintf(
|
||||
cause, "can't use hardcopy terminal: %s", name);
|
||||
break;
|
||||
case 0:
|
||||
xasprintf(cause, "missing or unsuitable terminal: %s", name);
|
||||
xasprintf(
|
||||
cause, "missing or unsuitable terminal: %s", name);
|
||||
break;
|
||||
case -1:
|
||||
xasprintf(cause, "can't find terminfo database");
|
||||
|
56
tty.c
56
tty.c
@ -44,7 +44,7 @@ void tty_redraw_region(struct tty *, const struct tty_ctx *);
|
||||
void tty_emulate_repeat(
|
||||
struct tty *, enum tty_code_code, enum tty_code_code, u_int);
|
||||
void tty_cell(struct tty *,
|
||||
const struct grid_cell *, const struct grid_utf8 *);
|
||||
const struct grid_cell *, const struct grid_utf8 *);
|
||||
|
||||
void
|
||||
tty_init(struct tty *tty, int fd, char *term)
|
||||
@ -562,7 +562,7 @@ tty_write(void (*cmdfn)(
|
||||
void
|
||||
tty_cmd_insertcharacter(struct tty *tty, const struct tty_ctx *ctx)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct screen *s = wp->screen;
|
||||
u_int i;
|
||||
|
||||
@ -573,7 +573,7 @@ tty_cmd_insertcharacter(struct tty *tty, const struct tty_ctx *ctx)
|
||||
|
||||
tty_reset(tty);
|
||||
|
||||
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
|
||||
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
|
||||
|
||||
if (tty_term_has(tty->term, TTYC_ICH) ||
|
||||
tty_term_has(tty->term, TTYC_ICH1))
|
||||
@ -591,7 +591,7 @@ tty_cmd_insertcharacter(struct tty *tty, const struct tty_ctx *ctx)
|
||||
void
|
||||
tty_cmd_deletecharacter(struct tty *tty, const struct tty_ctx *ctx)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct screen *s = wp->screen;
|
||||
|
||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
||||
@ -603,7 +603,7 @@ tty_cmd_deletecharacter(struct tty *tty, const struct tty_ctx *ctx)
|
||||
|
||||
tty_reset(tty);
|
||||
|
||||
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
|
||||
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
|
||||
|
||||
if (tty_term_has(tty->term, TTYC_DCH) ||
|
||||
tty_term_has(tty->term, TTYC_DCH1))
|
||||
@ -613,10 +613,10 @@ tty_cmd_deletecharacter(struct tty *tty, const struct tty_ctx *ctx)
|
||||
void
|
||||
tty_cmd_insertline(struct tty *tty, const struct tty_ctx *ctx)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct screen *s = wp->screen;
|
||||
|
||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
||||
!tty_term_has(tty->term, TTYC_CSR) ||
|
||||
!tty_term_has(tty->term, TTYC_IL1)) {
|
||||
tty_redraw_region(tty, ctx);
|
||||
@ -625,8 +625,8 @@ tty_cmd_insertline(struct tty *tty, const struct tty_ctx *ctx)
|
||||
|
||||
tty_reset(tty);
|
||||
|
||||
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
|
||||
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
|
||||
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
|
||||
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
|
||||
|
||||
tty_emulate_repeat(tty, TTYC_IL, TTYC_IL1, ctx->num);
|
||||
}
|
||||
@ -634,10 +634,10 @@ tty_cmd_insertline(struct tty *tty, const struct tty_ctx *ctx)
|
||||
void
|
||||
tty_cmd_deleteline(struct tty *tty, const struct tty_ctx *ctx)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct screen *s = wp->screen;
|
||||
|
||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
||||
!tty_term_has(tty->term, TTYC_CSR) ||
|
||||
!tty_term_has(tty->term, TTYC_DL1)) {
|
||||
tty_redraw_region(tty, ctx);
|
||||
@ -646,8 +646,8 @@ tty_cmd_deleteline(struct tty *tty, const struct tty_ctx *ctx)
|
||||
|
||||
tty_reset(tty);
|
||||
|
||||
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
|
||||
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
|
||||
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
|
||||
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
|
||||
|
||||
tty_emulate_repeat(tty, TTYC_DL, TTYC_DL1, ctx->num);
|
||||
}
|
||||
@ -655,13 +655,13 @@ tty_cmd_deleteline(struct tty *tty, const struct tty_ctx *ctx)
|
||||
void
|
||||
tty_cmd_clearline(struct tty *tty, const struct tty_ctx *ctx)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct screen *s = wp->screen;
|
||||
u_int i;
|
||||
|
||||
tty_reset(tty);
|
||||
|
||||
tty_cursor_pane(tty, ctx, 0, ctx->ocy);
|
||||
tty_cursor_pane(tty, ctx, 0, ctx->ocy);
|
||||
|
||||
if (wp->xoff == 0 && screen_size_x(s) >= tty->sx &&
|
||||
tty_term_has(tty->term, TTYC_EL)) {
|
||||
@ -675,7 +675,7 @@ tty_cmd_clearline(struct tty *tty, const struct tty_ctx *ctx)
|
||||
void
|
||||
tty_cmd_clearendofline(struct tty *tty, const struct tty_ctx *ctx)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct screen *s = wp->screen;
|
||||
u_int i;
|
||||
|
||||
@ -695,7 +695,7 @@ tty_cmd_clearendofline(struct tty *tty, const struct tty_ctx *ctx)
|
||||
void
|
||||
tty_cmd_clearstartofline(struct tty *tty, const struct tty_ctx *ctx)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
u_int i;
|
||||
|
||||
tty_reset(tty);
|
||||
@ -713,13 +713,13 @@ tty_cmd_clearstartofline(struct tty *tty, const struct tty_ctx *ctx)
|
||||
void
|
||||
tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct screen *s = wp->screen;
|
||||
|
||||
if (ctx->ocy != ctx->orupper)
|
||||
return;
|
||||
|
||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
||||
!tty_term_has(tty->term, TTYC_CSR) ||
|
||||
!tty_term_has(tty->term, TTYC_RI)) {
|
||||
tty_redraw_region(tty, ctx);
|
||||
@ -737,13 +737,13 @@ tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx)
|
||||
void
|
||||
tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct screen *s = wp->screen;
|
||||
|
||||
if (ctx->ocy != ctx->orlower)
|
||||
return;
|
||||
|
||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
||||
!tty_term_has(tty->term, TTYC_CSR)) {
|
||||
tty_redraw_region(tty, ctx);
|
||||
return;
|
||||
@ -768,7 +768,7 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
|
||||
void
|
||||
tty_cmd_clearendofscreen(struct tty *tty, const struct tty_ctx *ctx)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct screen *s = wp->screen;
|
||||
u_int i, j;
|
||||
|
||||
@ -804,7 +804,7 @@ tty_cmd_clearendofscreen(struct tty *tty, const struct tty_ctx *ctx)
|
||||
void
|
||||
tty_cmd_clearstartofscreen(struct tty *tty, const struct tty_ctx *ctx)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct screen *s = wp->screen;
|
||||
u_int i, j;
|
||||
|
||||
@ -834,7 +834,7 @@ tty_cmd_clearstartofscreen(struct tty *tty, const struct tty_ctx *ctx)
|
||||
void
|
||||
tty_cmd_clearscreen(struct tty *tty, const struct tty_ctx *ctx)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct screen *s = wp->screen;
|
||||
u_int i, j;
|
||||
|
||||
@ -980,7 +980,7 @@ void
|
||||
tty_region_pane(
|
||||
struct tty *tty, const struct tty_ctx *ctx, u_int rupper, u_int rlower)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
|
||||
tty_region(tty, wp->yoff + rupper, wp->yoff + rlower);
|
||||
}
|
||||
@ -1016,7 +1016,7 @@ tty_region(struct tty *tty, u_int rupper, u_int rlower)
|
||||
void
|
||||
tty_cursor_pane(struct tty *tty, const struct tty_ctx *ctx, u_int cx, u_int cy)
|
||||
{
|
||||
struct window_pane *wp = ctx->wp;
|
||||
struct window_pane *wp = ctx->wp;
|
||||
|
||||
tty_cursor(tty, wp->xoff + cx, wp->yoff + cy);
|
||||
}
|
||||
@ -1120,8 +1120,8 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
|
||||
change = thisy - cy; /* +ve up, -ve down */
|
||||
|
||||
/*
|
||||
* Try to use VPA if change is larger than absolute or if this change
|
||||
* would cross the scroll region, otherwise use CUU/CUD.
|
||||
* Try to use VPA if change is larger than absolute or if this
|
||||
* change would cross the scroll region, otherwise use CUU/CUD.
|
||||
*/
|
||||
if (abs(change) > cy ||
|
||||
(change < 0 && cy - change > tty->rlower) ||
|
||||
|
@ -27,11 +27,11 @@ void window_choose_free(struct window_pane *);
|
||||
void window_choose_resize(struct window_pane *, u_int, u_int);
|
||||
void window_choose_key(struct window_pane *, struct client *, int);
|
||||
void window_choose_mouse(
|
||||
struct window_pane *, struct client *, struct mouse_event *);
|
||||
struct window_pane *, struct client *, struct mouse_event *);
|
||||
|
||||
void window_choose_redraw_screen(struct window_pane *);
|
||||
void window_choose_write_line(
|
||||
struct window_pane *, struct screen_write_ctx *, u_int);
|
||||
struct window_pane *, struct screen_write_ctx *, u_int);
|
||||
|
||||
void window_choose_scroll_up(struct window_pane *);
|
||||
void window_choose_scroll_down(struct window_pane *);
|
||||
@ -247,7 +247,7 @@ window_choose_key(struct window_pane *wp, unused struct client *c, int key)
|
||||
else
|
||||
data->top -= screen_size_y(s);
|
||||
}
|
||||
window_choose_redraw_screen(wp);
|
||||
window_choose_redraw_screen(wp);
|
||||
break;
|
||||
case MODEKEYCHOICE_PAGEDOWN:
|
||||
data->selected += screen_size_y(s);
|
||||
@ -312,7 +312,7 @@ window_choose_write_line(
|
||||
struct options *oo = &wp->window->options;
|
||||
struct screen *s = &data->screen;
|
||||
struct grid_cell gc;
|
||||
int utf8flag;
|
||||
int utf8flag;
|
||||
char key;
|
||||
|
||||
if (data->callbackfn == NULL)
|
||||
|
@ -78,7 +78,7 @@ window_clock_resize(struct window_pane *wp, u_int sx, u_int sy)
|
||||
struct window_clock_mode_data *data = wp->modedata;
|
||||
struct screen *s = &data->screen;
|
||||
|
||||
screen_resize(s, sx, sy);
|
||||
screen_resize(s, sx, sy);
|
||||
window_clock_draw_screen(wp);
|
||||
}
|
||||
|
||||
|
@ -29,14 +29,14 @@ void window_copy_resize(struct window_pane *, u_int, u_int);
|
||||
void window_copy_key(struct window_pane *, struct client *, int);
|
||||
int window_copy_key_input(struct window_pane *, int);
|
||||
void window_copy_mouse(
|
||||
struct window_pane *, struct client *, struct mouse_event *);
|
||||
struct window_pane *, struct client *, struct mouse_event *);
|
||||
|
||||
void window_copy_redraw_lines(struct window_pane *, u_int, u_int);
|
||||
void window_copy_redraw_screen(struct window_pane *);
|
||||
void window_copy_write_line(
|
||||
struct window_pane *, struct screen_write_ctx *, u_int);
|
||||
struct window_pane *, struct screen_write_ctx *, u_int);
|
||||
void window_copy_write_lines(
|
||||
struct window_pane *, struct screen_write_ctx *, u_int, u_int);
|
||||
struct window_pane *, struct screen_write_ctx *, u_int, u_int);
|
||||
|
||||
void window_copy_scroll_to(struct window_pane *, u_int, u_int);
|
||||
int window_copy_search_compare(
|
||||
@ -233,7 +233,7 @@ window_copy_key(struct window_pane *wp, struct client *c, int key)
|
||||
return;
|
||||
case MODEKEYCOPY_RIGHT:
|
||||
window_copy_cursor_right(wp);
|
||||
return;
|
||||
return;
|
||||
case MODEKEYCOPY_UP:
|
||||
window_copy_cursor_up(wp, 0);
|
||||
return;
|
||||
@ -297,7 +297,7 @@ window_copy_key(struct window_pane *wp, struct client *c, int key)
|
||||
window_copy_redraw_screen(wp);
|
||||
break;
|
||||
case MODEKEYCOPY_STARTSELECTION:
|
||||
window_copy_start_selection(wp);
|
||||
window_copy_start_selection(wp);
|
||||
window_copy_redraw_screen(wp);
|
||||
break;
|
||||
case MODEKEYCOPY_CLEARSELECTION:
|
||||
@ -452,7 +452,7 @@ window_copy_mouse(
|
||||
|
||||
window_copy_update_cursor(wp, m->x, m->y);
|
||||
if (window_copy_update_selection(wp))
|
||||
window_copy_redraw_screen(wp);
|
||||
window_copy_redraw_screen(wp);
|
||||
}
|
||||
|
||||
void
|
||||
@ -476,7 +476,7 @@ window_copy_scroll_to(struct window_pane *wp, u_int px, u_int py)
|
||||
offset = py + gap - gd->sy;
|
||||
data->cy = py - offset;
|
||||
}
|
||||
data->oy = gd->hsize - offset;
|
||||
data->oy = gd->hsize - offset;
|
||||
|
||||
window_copy_redraw_screen(wp);
|
||||
}
|
||||
@ -893,8 +893,8 @@ window_copy_copy_line(struct window_pane *wp,
|
||||
char **buf, size_t *off, u_int sy, u_int sx, u_int ex)
|
||||
{
|
||||
struct grid *gd = wp->base.grid;
|
||||
const struct grid_cell *gc;
|
||||
const struct grid_utf8 *gu;
|
||||
const struct grid_cell *gc;
|
||||
const struct grid_utf8 *gu;
|
||||
struct grid_line *gl;
|
||||
u_int i, xx, wrapped = 0;
|
||||
size_t size;
|
||||
@ -907,7 +907,7 @@ window_copy_copy_line(struct window_pane *wp,
|
||||
* on screen.
|
||||
*/
|
||||
gl = &gd->linedata[sy];
|
||||
if (gl->flags & GRID_LINE_WRAPPED && gl->cellsize <= gd->sx)
|
||||
if (gl->flags & GRID_LINE_WRAPPED && gl->cellsize <= gd->sx)
|
||||
wrapped = 1;
|
||||
|
||||
/* If the line was wrapped, don't strip spaces (use the full length). */
|
||||
@ -938,7 +938,7 @@ window_copy_copy_line(struct window_pane *wp,
|
||||
}
|
||||
|
||||
/* Only add a newline if the line wasn't wrapped. */
|
||||
if (!wrapped) {
|
||||
if (!wrapped) {
|
||||
*buf = xrealloc(*buf, 1, (*off) + 1);
|
||||
(*buf)[(*off)++] = '\n';
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ void window_more_key(struct window_pane *, struct client *, int);
|
||||
|
||||
void window_more_redraw_screen(struct window_pane *);
|
||||
void window_more_write_line(
|
||||
struct window_pane *, struct screen_write_ctx *, u_int);
|
||||
struct window_pane *, struct screen_write_ctx *, u_int);
|
||||
|
||||
void window_more_scroll_up(struct window_pane *);
|
||||
void window_more_scroll_down(struct window_pane *);
|
||||
@ -169,7 +169,7 @@ window_more_write_line(
|
||||
struct grid_cell gc;
|
||||
char *msg, hdr[32];
|
||||
size_t size;
|
||||
int utf8flag;
|
||||
int utf8flag;
|
||||
|
||||
utf8flag = options_get_number(&wp->window->options, "utf8");
|
||||
memcpy(&gc, &grid_default_cell, sizeof gc);
|
||||
|
4
window.c
4
window.c
@ -428,7 +428,7 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
|
||||
wp->layout_cell = NULL;
|
||||
|
||||
wp->xoff = 0;
|
||||
wp->yoff = 0;
|
||||
wp->yoff = 0;
|
||||
|
||||
wp->sx = sx;
|
||||
wp->sy = sy;
|
||||
@ -513,7 +513,7 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell,
|
||||
ws.ws_col = screen_size_x(&wp->base);
|
||||
ws.ws_row = screen_size_y(&wp->base);
|
||||
|
||||
switch (wp->pid = forkpty(&wp->fd, wp->tty, NULL, &ws)) {
|
||||
switch (wp->pid = forkpty(&wp->fd, wp->tty, NULL, &ws)) {
|
||||
case -1:
|
||||
wp->fd = -1;
|
||||
xasprintf(cause, "%s: %s", cmd, strerror(errno));
|
||||
|
@ -132,7 +132,7 @@ xterm_keys_modifiers(const char *template, const char *buf, size_t len)
|
||||
case '7':
|
||||
return (KEYC_ESCAPE|KEYC_CTRL);
|
||||
case '8':
|
||||
return (KEYC_SHIFT|KEYC_ESCAPE|KEYC_CTRL);
|
||||
return (KEYC_SHIFT|KEYC_ESCAPE|KEYC_CTRL);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user