summaryrefslogtreecommitdiffstats
path: root/cmd-switch-client.c
AgeCommit message (Collapse)Author
2020-03-06Update latest client for target session on switch-client.nicm
2019-08-14Add -Z flag to rotate-window, select-pane, swap-pane, switch-client tonicm
preserve zoomed state. GitHub issue 1839.
2019-04-17Document that switch-client can change all of session,window,pane andnicm
check for % in the target as well as ":.".
2019-04-17Break new window and pane creation common code from various commands andnicm
window.c into a separate file spawn.c.
2018-11-06Correctly unzoom and redraw panes in switch-client.nicm
2018-10-18Support for windows larger than visible on the attached client. This hasnicm
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.
2017-08-30Pass flags into cmd_find_from_* to fix prefer-unattached, reported bynicm
Thomas Sattler.
2017-05-04Some new notifications, mainly for active pane and current window andnicm
session: pane-mode-changed window-pane-changed client-session-changed session-window-changed From Joshua Brot.
2017-04-22Get rid of the extra layer of flags and cmd_prepare() and just store thenicm
CMD_FIND_* flags in the cmd_entry and call it for the command. Commands with special requirements call it themselves and update the target for hooks to use.
2017-04-22Mouse bindings and hooks set up an initial current state when running anicm
command. This is used for the session, window and pane for all commands in the command sequence if there is no -t or -s. However, using it for all commands in the command sequence means that if the active pane or current session is changed, subsequent commands still use the previous state. So make commands which explicitly change the current state (such as neww and selectp) update it themselves for later commands. Commands which may invalidate the state (like killp) are already OK because an invalid state will be ignored. Also fill in the current state for all key bindings rather than just the mouse, so that any omissions are easier to spot.
2017-04-21Store state shared between multiple commands in the queue in a sharednicm
structure.
2017-02-06Cancel key table when switching session, unless the key is going tonicm
repeat. Reported by Amos Bird.
2017-01-28Do not clear the key table when changing session on a client, so thatnicm
switch-client and friends work with bind -n.
2017-01-24Make update-environment an array as well.nicm
2017-01-06Nits found with clang.nicm
2016-10-16Mass rename struct cmd_q to struct cmdq_item and related.nicm
2016-10-10Add static in cmd-* and fix a few other nits.nicm
2016-01-19I no longer use my SourceForge address so replace it.nicm
2015-12-23Repair switch-client -l and switch-client with a window target.nicm
2015-12-14Instead of combined flags for -c, -s, -t, split into different setsnicm
using an enum and simplify the parsing code.
2015-12-13Use member names in cmd_entry definitions so I stop getting confusednicm
about the order.
2015-12-13Instead of every command resolving the target (-t or -s) itself, preparenicm
the state (client, session, winlink, pane) for it it before entering the command. Each command provides some flags that tell the prepare step what it is expecting. This is a requirement for having hooks on commands (for example, if you hook "select-window -t1:2", the hook command should to operate on window 1:2 not whatever it thinks is the current window), and should allow some other target improvements. The old cmd_find_* functions remain for the moment but that layer will be dropped later. Joint work with Thomas Adam.
2015-12-12Add key-table option to set the default key table for a session, allowsnicm
different key bindings for different sessions and a few other things.
2015-12-12Return after changing key table.nicm
2015-12-11Check alerts when session changes, from Patrick Palka.nicm
2015-12-08Use ^= instead of a verbose alternative. ok nicm@mmcc
2015-10-28Like options, move the environ struct into environ.c.nicm
2015-10-27Move struct options into options.c.nicm
2015-09-22Don't update last session when the session is unchanged, from Sina Siadat.nicm
2015-09-10Add session_last_attached time and format, from Sina Siadat.nicm
2015-08-28Make session_update_activity more useful and use it in more places.nicm
2015-08-28Run status update on a per-client timer at status-interval.nicm
2015-07-06Update environment with -E when attach-session used on an alreadynicm
attached session or switch-client used on the current session. From Cam Hutchison.
2015-06-07Add -E flag when attaching or switching client to bypassnicm
update-environment, from Steven Lu.
2015-05-07Update environment when switching sessions as well as attaching, from Sinicm
Beaumont.
2015-04-25Move the functions to convert ids from strings into session.c and window.c.nicm
2015-04-20Support for multiple key tables to commands to be bound to sequences ofnicm
keys. The default key bindings become the "prefix" table and -n the "root" table. Keys may be bound in new tables with bind -T and switch-client -T used to specify the table in which the next key should be looked up. Based on a diff from Keith Amling.
2014-10-20Instead of setting up the default keys by building the key structnicm
directly with a helper function in the cmd_entry, include a table of bind-key commands and pass them through the command parser and a temporary cmd_q. As well as being smaller, this will allow default bindings to be command sequences which will probably be needed soon.
2014-04-17Remove the "info" message mechanism, this was only used for about fivenicm
mostly useless and annoying messages. Change those commands to silence on success like all the others. Still accept the -q command line flag and "quiet" server option for now.
2014-02-12Avoid use of uninitialized variable, from Thomas Adam.nicm
2014-01-09Similar to attach-session, make switch-client -t accept a window andnicm
pane. From Johannes Jakobsson.
2013-10-10Remove the barely-used and unnecessary command check() function.nicm
2013-03-24Add a command queue to standardize and simplify commands that call otherNicholas Marriott
commands and allow a command to block execution of subsequent commands. This allows run-shell and if-shell to be synchronous which has been much requested. Each client has a default command queue and commands are consumed one at a time from it. A command may suspend execution from the queue by returning CMD_RETURN_WAIT and then resume it by calling cmd_continue() - for example run-shell does this from the callback that is fired after the job is freed. When the command queue becomes empty, command clients are automatically exited (unless attaching). A callback is also fired - this is used for nested commands in, for example, if-shell which can block execution of the client's cmdq until a new cmdq becomes empty. Also merge all the old error/info/print functions together and lose the old curclient/cmdclient distinction - a cmdq is bound to one client (or none if in the configuration file), this is a command client if c->session is NULL otherwise an attached client.
2013-03-24Fix error reporting for client commands by adding a flag toNicholas Marriott
cmd_find_client to tell it whether or not to show errors, sometimes it's needed and sometimes not.
2012-07-11Make command exec functions return an enum rather than -1/0/1 values andNicholas Marriott
add a new value to mean "leave client running but don't attach" to fix problems with using some commands in a command sequence. Most of the work by Thomas Adam, problem reported by "jspenguin" on SF bug 3535531.
2012-01-21Only hide flags on the current window when the session is attached, fromNicholas Marriott
Roland Walker.
2011-08-16Add a -r flag to switch-client to toggle the client read-only flag. FromNicholas Marriott
Johan Commelin.
2011-04-05Add a flag to cmd_find_session so that attach-session can preferNicholas Marriott
unattached sessions when choosing the most recently used (if -t is not given). Suggested by claudio@.
2011-01-04Clean up and simplify tmux command argument parsing.Nicholas Marriott
Originally, tmux commands were parsed in the client process into a struct with the command data which was then serialised and sent to the server to be executed. The parsing was later moved into the server (an argv was sent from the client), but the parse step and intermediate struct was kept. This change removes that struct and the separate parse step. Argument parsing and printing is now common to all commands (in arguments.c) with each command left with just an optional check function (to validate the arguments at parse time), the exec function and a function to set up any key bindings (renamed from the old init function). This is overall more simple and consistent. There should be no changes to any commands behaviour or syntax although as this touches every command please watch for any unexpected changes.
2011-01-01Don't reset the activity timer for unattached sessions every second,Nicholas Marriott
this screws up the choice of most-recently-used. Instead, break the time update into a little function and do it when the session is attached. Pointed out by joshe@.