2009-06-01 22:58:49 +00:00
|
|
|
/* $OpenBSD$ */
|
|
|
|
|
|
|
|
/*
|
2016-01-19 15:59:12 +00:00
|
|
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
2009-06-01 22:58:49 +00:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
#include <stdlib.h>
|
2019-07-10 11:20:10 +00:00
|
|
|
#include <string.h>
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
|
2009-06-01 22:58:49 +00:00
|
|
|
#include "tmux.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Refresh client.
|
|
|
|
*/
|
|
|
|
|
2017-01-10 19:45:55 +00:00
|
|
|
static enum cmd_retval cmd_refresh_client_exec(struct cmd *,
|
|
|
|
struct cmdq_item *);
|
2009-06-01 22:58:49 +00:00
|
|
|
|
|
|
|
const struct cmd_entry cmd_refresh_client_entry = {
|
2015-12-13 21:53:57 +00:00
|
|
|
.name = "refresh-client",
|
|
|
|
.alias = "refresh",
|
|
|
|
|
2022-03-08 12:01:19 +00:00
|
|
|
.args = { "A:B:cC:Df:F:l::LRSt:U", 0, 1, NULL },
|
2020-07-06 09:14:20 +00:00
|
|
|
.usage = "[-cDlLRSU] [-A pane:state] [-B name:what:format] "
|
|
|
|
"[-C XxY] [-f flags] " CMD_TARGET_CLIENT_USAGE " [adjustment]",
|
2015-12-13 21:53:57 +00:00
|
|
|
|
2020-04-13 20:51:57 +00:00
|
|
|
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG,
|
2015-12-13 21:53:57 +00:00
|
|
|
.exec = cmd_refresh_client_exec
|
2009-06-01 22:58:49 +00:00
|
|
|
};
|
|
|
|
|
2020-07-06 09:14:20 +00:00
|
|
|
static void
|
|
|
|
cmd_refresh_client_update_subscription(struct client *tc, const char *value)
|
|
|
|
{
|
|
|
|
char *copy, *split, *name, *what;
|
|
|
|
enum control_sub_type subtype;
|
|
|
|
int subid = -1;
|
|
|
|
|
|
|
|
copy = name = xstrdup(value);
|
|
|
|
if ((split = strchr(copy, ':')) == NULL) {
|
|
|
|
control_remove_sub(tc, copy);
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
*split++ = '\0';
|
|
|
|
|
|
|
|
what = split;
|
|
|
|
if ((split = strchr(what, ':')) == NULL)
|
|
|
|
goto out;
|
|
|
|
*split++ = '\0';
|
|
|
|
|
|
|
|
if (strcmp(what, "%*") == 0)
|
|
|
|
subtype = CONTROL_SUB_ALL_PANES;
|
|
|
|
else if (sscanf(what, "%%%d", &subid) == 1 && subid >= 0)
|
|
|
|
subtype = CONTROL_SUB_PANE;
|
|
|
|
else if (strcmp(what, "@*") == 0)
|
|
|
|
subtype = CONTROL_SUB_ALL_WINDOWS;
|
|
|
|
else if (sscanf(what, "@%d", &subid) == 1 && subid >= 0)
|
|
|
|
subtype = CONTROL_SUB_WINDOW;
|
|
|
|
else
|
|
|
|
subtype = CONTROL_SUB_SESSION;
|
|
|
|
control_add_sub(tc, name, subtype, subid, split);
|
|
|
|
|
|
|
|
out:
|
|
|
|
free(copy);
|
|
|
|
}
|
|
|
|
|
2021-08-27 17:15:57 +00:00
|
|
|
static enum cmd_retval
|
|
|
|
cmd_refresh_client_control_client_size(struct cmd *self, struct cmdq_item *item)
|
|
|
|
{
|
|
|
|
struct args *args = cmd_get_args(self);
|
|
|
|
struct client *tc = cmdq_get_target_client(item);
|
|
|
|
const char *size = args_get(args, 'C');
|
|
|
|
u_int w, x, y;
|
|
|
|
struct client_window *cw;
|
|
|
|
|
|
|
|
if (sscanf(size, "@%u:%ux%u", &w, &x, &y) == 3) {
|
|
|
|
if (x < WINDOW_MINIMUM || x > WINDOW_MAXIMUM ||
|
|
|
|
y < WINDOW_MINIMUM || y > WINDOW_MAXIMUM) {
|
|
|
|
cmdq_error(item, "size too small or too big");
|
|
|
|
return (CMD_RETURN_ERROR);
|
|
|
|
}
|
|
|
|
log_debug("%s: client %s window @%u: size %ux%u", __func__,
|
|
|
|
tc->name, w, x, y);
|
|
|
|
cw = server_client_add_client_window(tc, w);
|
|
|
|
cw->sx = x;
|
|
|
|
cw->sy = y;
|
|
|
|
tc->flags |= CLIENT_WINDOWSIZECHANGED;
|
|
|
|
recalculate_sizes_now(1);
|
|
|
|
return (CMD_RETURN_NORMAL);
|
|
|
|
}
|
|
|
|
if (sscanf(size, "@%u:", &w) == 1) {
|
|
|
|
cw = server_client_get_client_window(tc, w);
|
|
|
|
if (cw != NULL) {
|
|
|
|
log_debug("%s: client %s window @%u: no size", __func__,
|
|
|
|
tc->name, w);
|
|
|
|
cw->sx = 0;
|
|
|
|
cw->sy = 0;
|
|
|
|
recalculate_sizes_now(1);
|
|
|
|
}
|
|
|
|
return (CMD_RETURN_NORMAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sscanf(size, "%u,%u", &x, &y) != 2 &&
|
|
|
|
sscanf(size, "%ux%u", &x, &y) != 2) {
|
|
|
|
cmdq_error(item, "bad size argument");
|
|
|
|
return (CMD_RETURN_ERROR);
|
|
|
|
}
|
|
|
|
if (x < WINDOW_MINIMUM || x > WINDOW_MAXIMUM ||
|
|
|
|
y < WINDOW_MINIMUM || y > WINDOW_MAXIMUM) {
|
|
|
|
cmdq_error(item, "size too small or too big");
|
|
|
|
return (CMD_RETURN_ERROR);
|
|
|
|
}
|
|
|
|
tty_set_size(&tc->tty, x, y, 0, 0);
|
|
|
|
tc->flags |= CLIENT_SIZECHANGED;
|
|
|
|
recalculate_sizes_now(1);
|
|
|
|
return (CMD_RETURN_NORMAL);
|
|
|
|
}
|
|
|
|
|
2020-05-21 07:24:13 +00:00
|
|
|
static void
|
|
|
|
cmd_refresh_client_update_offset(struct client *tc, const char *value)
|
|
|
|
{
|
|
|
|
struct window_pane *wp;
|
2020-07-06 09:14:20 +00:00
|
|
|
char *copy, *split;
|
2020-05-21 07:24:13 +00:00
|
|
|
u_int pane;
|
|
|
|
|
|
|
|
if (*value != '%')
|
|
|
|
return;
|
|
|
|
copy = xstrdup(value);
|
2020-07-06 09:14:20 +00:00
|
|
|
if ((split = strchr(copy, ':')) == NULL)
|
2020-05-21 07:24:13 +00:00
|
|
|
goto out;
|
2020-07-06 09:14:20 +00:00
|
|
|
*split++ = '\0';
|
2020-05-21 07:24:13 +00:00
|
|
|
|
|
|
|
if (sscanf(copy, "%%%u", &pane) != 1)
|
|
|
|
goto out;
|
|
|
|
wp = window_pane_find_by_id(pane);
|
|
|
|
if (wp == NULL)
|
|
|
|
goto out;
|
|
|
|
|
2020-07-06 09:14:20 +00:00
|
|
|
if (strcmp(split, "on") == 0)
|
2020-05-22 11:07:04 +00:00
|
|
|
control_set_pane_on(tc, wp);
|
2020-07-06 09:14:20 +00:00
|
|
|
else if (strcmp(split, "off") == 0)
|
2020-05-22 11:07:04 +00:00
|
|
|
control_set_pane_off(tc, wp);
|
2020-07-06 09:14:20 +00:00
|
|
|
else if (strcmp(split, "continue") == 0)
|
2020-06-05 07:33:57 +00:00
|
|
|
control_continue_pane(tc, wp);
|
2020-07-06 09:14:20 +00:00
|
|
|
else if (strcmp(split, "pause") == 0)
|
2020-06-11 09:55:47 +00:00
|
|
|
control_pause_pane(tc, wp);
|
2020-05-21 07:24:13 +00:00
|
|
|
|
|
|
|
out:
|
|
|
|
free(copy);
|
|
|
|
}
|
|
|
|
|
2022-03-08 12:01:19 +00:00
|
|
|
static enum cmd_retval
|
|
|
|
cmd_refresh_client_clipboard(struct cmd *self, struct cmdq_item *item)
|
|
|
|
{
|
|
|
|
struct args *args = cmd_get_args(self);
|
|
|
|
struct client *tc = cmdq_get_target_client(item);
|
|
|
|
const char *p;
|
|
|
|
u_int i;
|
|
|
|
struct cmd_find_state fs;
|
|
|
|
|
|
|
|
p = args_get(args, 'l');
|
|
|
|
if (p == NULL) {
|
|
|
|
if (tc->flags & CLIENT_CLIPBOARDBUFFER)
|
|
|
|
return (CMD_RETURN_NORMAL);
|
|
|
|
tc->flags |= CLIENT_CLIPBOARDBUFFER;
|
|
|
|
} else {
|
|
|
|
if (cmd_find_target(&fs, item, p, CMD_FIND_PANE, 0) != 0)
|
|
|
|
return (CMD_RETURN_ERROR);
|
|
|
|
for (i = 0; i < tc->clipboard_npanes; i++) {
|
|
|
|
if (tc->clipboard_panes[i] == fs.wp->id)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (i != tc->clipboard_npanes)
|
|
|
|
return (CMD_RETURN_NORMAL);
|
2022-05-30 12:55:25 +00:00
|
|
|
tc->clipboard_panes = xreallocarray(tc->clipboard_panes,
|
2022-03-08 12:01:19 +00:00
|
|
|
tc->clipboard_npanes + 1, sizeof *tc->clipboard_panes);
|
|
|
|
tc->clipboard_panes[tc->clipboard_npanes++] = fs.wp->id;
|
|
|
|
}
|
|
|
|
tty_clipboard_query(&tc->tty);
|
|
|
|
return (CMD_RETURN_NORMAL);
|
|
|
|
}
|
|
|
|
|
2016-10-10 21:51:39 +00:00
|
|
|
static enum cmd_retval
|
2016-10-16 19:04:05 +00:00
|
|
|
cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item)
|
2009-06-01 22:58:49 +00:00
|
|
|
{
|
2020-05-21 07:24:13 +00:00
|
|
|
struct args *args = cmd_get_args(self);
|
|
|
|
struct client *tc = cmdq_get_target_client(item);
|
|
|
|
struct tty *tty = &tc->tty;
|
|
|
|
struct window *w;
|
2021-08-27 17:15:57 +00:00
|
|
|
const char *errstr;
|
|
|
|
u_int adjust;
|
2020-05-21 07:24:13 +00:00
|
|
|
struct args_value *av;
|
2009-06-01 22:58:49 +00:00
|
|
|
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
if (args_has(args, 'c') ||
|
|
|
|
args_has(args, 'L') ||
|
|
|
|
args_has(args, 'R') ||
|
|
|
|
args_has(args, 'U') ||
|
|
|
|
args_has(args, 'D'))
|
|
|
|
{
|
2021-08-20 19:50:16 +00:00
|
|
|
if (args_count(args) == 0)
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
adjust = 1;
|
|
|
|
else {
|
2021-08-20 19:50:16 +00:00
|
|
|
adjust = strtonum(args_string(args, 0), 1, INT_MAX,
|
|
|
|
&errstr);
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
if (errstr != NULL) {
|
|
|
|
cmdq_error(item, "adjustment %s", errstr);
|
|
|
|
return (CMD_RETURN_ERROR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (args_has(args, 'c'))
|
2020-04-13 20:51:57 +00:00
|
|
|
tc->pan_window = NULL;
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
else {
|
2020-04-13 20:51:57 +00:00
|
|
|
w = tc->session->curw->window;
|
|
|
|
if (tc->pan_window != w) {
|
|
|
|
tc->pan_window = w;
|
|
|
|
tc->pan_ox = tty->oox;
|
|
|
|
tc->pan_oy = tty->ooy;
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
}
|
|
|
|
if (args_has(args, 'L')) {
|
2020-04-13 20:51:57 +00:00
|
|
|
if (tc->pan_ox > adjust)
|
|
|
|
tc->pan_ox -= adjust;
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
else
|
2020-04-13 20:51:57 +00:00
|
|
|
tc->pan_ox = 0;
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
} else if (args_has(args, 'R')) {
|
2020-04-13 20:51:57 +00:00
|
|
|
tc->pan_ox += adjust;
|
|
|
|
if (tc->pan_ox > w->sx - tty->osx)
|
|
|
|
tc->pan_ox = w->sx - tty->osx;
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
} else if (args_has(args, 'U')) {
|
2020-04-13 20:51:57 +00:00
|
|
|
if (tc->pan_oy > adjust)
|
|
|
|
tc->pan_oy -= adjust;
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
else
|
2020-04-13 20:51:57 +00:00
|
|
|
tc->pan_oy = 0;
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
} else if (args_has(args, 'D')) {
|
2020-04-13 20:51:57 +00:00
|
|
|
tc->pan_oy += adjust;
|
|
|
|
if (tc->pan_oy > w->sy - tty->osy)
|
|
|
|
tc->pan_oy = w->sy - tty->osy;
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
}
|
|
|
|
}
|
2020-04-13 20:51:57 +00:00
|
|
|
tty_update_client_offset(tc);
|
|
|
|
server_redraw_client(tc);
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
return (CMD_RETURN_NORMAL);
|
|
|
|
}
|
2017-04-22 10:22:39 +00:00
|
|
|
|
2022-03-08 12:01:19 +00:00
|
|
|
if (args_has(args, 'l'))
|
|
|
|
return (cmd_refresh_client_clipboard(self, item));
|
2019-07-10 11:20:10 +00:00
|
|
|
|
2020-05-16 15:45:29 +00:00
|
|
|
if (args_has(args, 'F')) /* -F is an alias for -f */
|
|
|
|
server_client_set_flags(tc, args_get(args, 'F'));
|
|
|
|
if (args_has(args, 'f'))
|
|
|
|
server_client_set_flags(tc, args_get(args, 'f'));
|
|
|
|
|
2020-05-21 07:24:13 +00:00
|
|
|
if (args_has(args, 'A')) {
|
|
|
|
if (~tc->flags & CLIENT_CONTROL)
|
|
|
|
goto not_control_client;
|
2021-08-20 18:59:53 +00:00
|
|
|
av = args_first_value(args, 'A');
|
|
|
|
while (av != NULL) {
|
2021-08-21 10:28:05 +00:00
|
|
|
cmd_refresh_client_update_offset(tc, av->string);
|
2021-08-20 19:34:51 +00:00
|
|
|
av = args_next_value(av);
|
2020-05-20 06:18:22 +00:00
|
|
|
}
|
2020-05-21 07:24:13 +00:00
|
|
|
return (CMD_RETURN_NORMAL);
|
|
|
|
}
|
2020-07-06 09:14:20 +00:00
|
|
|
if (args_has(args, 'B')) {
|
|
|
|
if (~tc->flags & CLIENT_CONTROL)
|
|
|
|
goto not_control_client;
|
2021-08-20 18:59:53 +00:00
|
|
|
av = args_first_value(args, 'B');
|
|
|
|
while (av != NULL) {
|
2021-08-21 10:28:05 +00:00
|
|
|
cmd_refresh_client_update_subscription(tc, av->string);
|
2021-08-20 18:59:53 +00:00
|
|
|
av = args_next_value(av);
|
2020-07-06 09:14:20 +00:00
|
|
|
}
|
|
|
|
return (CMD_RETURN_NORMAL);
|
|
|
|
}
|
2020-05-21 07:24:13 +00:00
|
|
|
if (args_has(args, 'C')) {
|
|
|
|
if (~tc->flags & CLIENT_CONTROL)
|
|
|
|
goto not_control_client;
|
2021-08-27 17:15:57 +00:00
|
|
|
return (cmd_refresh_client_control_client_size(self, item));
|
Support for windows larger than visible on the attached client. This has
been a limitation for a long time.
There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.
The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.
If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.
Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).
The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.
For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..
If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.
The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.
The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.
2018-10-18 08:38:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (args_has(args, 'S')) {
|
2020-04-13 20:51:57 +00:00
|
|
|
tc->flags |= CLIENT_STATUSFORCE;
|
|
|
|
server_status_client(tc);
|
2015-09-14 10:25:52 +00:00
|
|
|
} else {
|
2020-04-13 20:51:57 +00:00
|
|
|
tc->flags |= CLIENT_STATUSFORCE;
|
|
|
|
server_redraw_client(tc);
|
2015-09-14 10:25:52 +00:00
|
|
|
}
|
2012-07-11 07:10:15 +00:00
|
|
|
return (CMD_RETURN_NORMAL);
|
2020-05-21 07:24:13 +00:00
|
|
|
|
|
|
|
not_control_client:
|
|
|
|
cmdq_error(item, "not a control client");
|
|
|
|
return (CMD_RETURN_ERROR);
|
2009-06-01 22:58:49 +00:00
|
|
|
}
|