summaryrefslogtreecommitdiffstats
path: root/cmd.c
AgeCommit message (Collapse)Author
2010-12-30Change from a per-session stack of buffers to one global stack which isNicholas Marriott
much more convenient and also simplifies lot of code. This renders copy-buffer useless and makes buffer-limit now a server option. By Tiago Cunha.
2010-12-21Store sessions in an RB tree by name rather than a list, this is tidierNicholas Marriott
and allows them to easily be shown sorted in various lists (list-sessions/choose-sessions). Keep a session index which is used in a couple of places internally but make it an ever-increasing number rather than filling in gaps with new sessions.
2010-10-29We now send argv to the server after parsing it in the client to get theNicholas Marriott
command, so the client should not modify it. Instead, take a copy. Fixes parsing command lists, reported by mcbride@.
2010-10-23Add a last-pane command (bound to ; by default). Requested ages ago byNicholas Marriott
somebody whose name I have forgotten.
2010-10-16Fall back on normal session choice method if $TMUX exists but is invalidNicholas Marriott
rather than rejecting.
2010-07-14Make pane/window wrapping more logical (so with 10 windows, +10 fromNicholas Marriott
window 5 stays in the same place), and tidy the code. From Tiago Cunha.
2010-06-21Add a choose-buffer command for easier use of the paste buffer stack.Nicholas Marriott
2010-06-21Extend the -t:+ and -t:- window targets for next and previous window toNicholas Marriott
accept an offset such as -t:+2. From Tiago Cunha.
2010-05-05Identical behaviour to select-prompt can now be obtained withNicholas Marriott
command-prompt, so remove select-prompt and change ' to be bound to command-prompt -p index "select-window -t :%%".
2010-03-22Support up, down, left, right movement through panes with -UDLR flags toNicholas Marriott
select-pane. Also REMOVE the up- and down-pane commands: equivalent behaviour is now available using -t :.+ and -t :.-.
2010-01-19Permit !, + and - to be used for window targets to specify last window (!), orNicholas Marriott
next and previous window by number (+ and -). Also tidy an if in cmd-new-window.c.
2010-01-07New command, join-pane, to split and move an existing pane into the space (likeNicholas Marriott
splitw then movep, or the reverse of breakp).
2009-12-08Permit panes to be referred to as "top", "bottom", "top-left" etc, if the rightNicholas Marriott
pane can be identified.
2009-12-03Massive spaces->tabs and trailing whitespace cleanup, hopefully for the lastNicholas Marriott
time now I've configured emacs to make them displayed in really annoying colours...
2009-12-01New command, capture-pane, which copies the entire pane contents to a pasteNicholas Marriott
buffer. From Jonathan Alvarado.
2009-11-21Use home from struct passwd if HOME is empty as well as if it is NULL, and fixNicholas Marriott
a style nit. Both from Tiago Cunha.
2009-11-18Add a per-client log of status line messages displayed while that clientNicholas Marriott
exists. A new message-limit session option sets the maximum number of entries and a command, show-messages, shows the log (bound to ~ by default). This (and prompt history) might be better as a single global log but until there are global options it is easier for them to be per client.
2009-11-03Add an activity time for clients, like for sessions, and change session andNicholas Marriott
client lookup to pick the most recently used rather than the most recently created - this is much more useful when used interactively and (because the activity time is set at creation) should have no effect on source-file. Based on a problem reported by Jan Johansson.
2009-11-03If it isn't available explicitly, work out the current client in a similar wayNicholas Marriott
to the current session - build a list of the possibilities then pick the newest.
2009-11-03Change session and client activity and creation time members to have moreNicholas Marriott
meaningful names. Also, remove the code to try and update the session activity time for the command client when a command message is received as is pointless because it des not have a session.
2009-11-02When matching the session names with -t, look for exact matches first beforeNicholas Marriott
trying partial matches. Avoids problems where two ambiguous matches are present before an exact match (eg foo1, foo2, foo would give an error on trying -tfoo), reported by Natacha Port? natbsd at instinctive dot eu.
2009-10-26tabs are better; ok nicmTheo Deraadt
2009-10-14cmd_find_client shouldn't die when there is an empty slot in the clientsNicholas Marriott
array. DOH.
2009-10-14Don't allow cmd_lookup_client to test clients without a session.Nicholas Marriott
2009-10-11Add a pipe-pane command to allow a pane to be piped to a shell command, forNicholas Marriott
example: pipe-pane 'cat >~/out' No arguments stops outputing and closes the pipe; the -o flag toggles a pipe and on and off (useful for key bindings). Suggested by espie@.
2009-10-10Split list-panes off from list-windows.Nicholas Marriott
2009-10-07Fix comment.Nicholas Marriott
2009-10-06Remove scroll mode which is now redundant, copy mode should be used instead.Nicholas Marriott
The = key binding now does nothing.
2009-10-05If no target client is specified to commands which accept one, try to guess theNicholas Marriott
current client, in a similar manner to how sessions already work: if the current session can be established and has only one client, use that; otherwise use the most recently created client.
2009-09-24New lock-client and lock-session commands to lock an individual client or allNicholas Marriott
clients attached to a session respectively.
2009-09-23Remove the internal tmux locking and instead detach each client and run theNicholas Marriott
command specified by a new option "lock-command" (by default "lock -np") in each client. This means each terminal has to be unlocked individually but simplifies the code and allows the system password to be used to unlock. Note that the set-password command is gone, so it will need to be removed from configuration files, and the -U command line flag has been removed. This is the third protocol version change so again it is best to stop the tmux server before upgrading.
2009-09-20run-shell command to run a shell command without opening a window, sendingNicholas Marriott
stdout to output mode.
2009-08-31Add a new display-panes command, with two options (display-panes-colour andNicholas Marriott
display-panes-time), which displays a visual indication of the number of each pane.
2009-08-25Add a choose-client command and extend choose-{session,window} to accept aNicholas Marriott
template. After a choice is made, %% (or %1) in the template is replaced by the name of the session, window or client suitable for -t and the result executed as a command. So, for example, "choose-window "killw -t '%%'"" will kill the selected window. The defaults if no template is given are (as now) select-window for choose-window, switch-client for choose-session, and detach-client for choose-client (now bound to D).
2009-08-23The cursession member in struct cmd_ctx is always either curclient->session orNicholas Marriott
NULL when curclient is also NULL, so just eliminate it.
2009-08-08Infrastructure and commands to manage the environment for processes startedNicholas Marriott
within tmux. There is a global environment, copied from the external environment when the server is started and each sesssion has an (initially empty) session environment which overrides it. New commands set-environment and show-environment manipulate or display the environments. A new session option, update-environment, is a space-separated list of variables which are updated from the external environment into the session environment every time a new session is created - the default is DISPLAY.
2009-07-30Merge pane number into the target specification for pane commands. Instead ofNicholas Marriott
using -p index, a target pane is now addressed with the normal -t window form but suffixed with a period and a pane index, for example :0.2 or mysess:mywin.1. An unadorned number such as -t 1 is tried as a pane index in the current window, if that fails the same rules are followed as for a target window and the current pane in that window used. As a side-effect this now means that swap-pane can swap panes between different windows. Note that this changes the syntax of the break-pane, clear-history, kill-pane, resize-pane, select-pane and swap-pane commands.
2009-07-29Add an additional heuristic to work out the current session when run from theNicholas Marriott
command line. The name of all slave ptys in the server is known, so if the client was run on a tty, look for any sessions containing that tty and use the most recently created. This is more reliable than looking at $TMUX if windows have been moved or linked between sessions.
2009-07-26Make all messages sent between the client and server fixed size.Nicholas Marriott
This is the first of two changes to make the protocol more resilient and less sensitive to other changes in the code, particularly with commands. The client now packs argv into a buffer and sends it to the server for parsing, rather than doing it itself and sending the parsed command data. As a side-effect this also removes a lot of now-unused command marshalling code. Mixing a server without this change and a client with or vice versa will cause tmux to hang or crash, please ensure that tmux is entirely killed before upgrading.
2009-07-24cmd_find_index should return -2 on error.Nicholas Marriott
2009-07-22Tidy the target parsing code a bit and correct the behaviour so that as beforeNicholas Marriott
a string with no colon as a target window is first looked up as a window then as a session, noted by Iain Morgan. Also attempt to clarify the description of the target specification in the man page.
2009-07-17- New command display-message (alias display) to display a message in theNicholas Marriott
status line (bound to "i" and displays the current window and time by default). The same substitutions are applied as for status-left/right. - Add support for including the window index (#I), pane index (#P) and window name (#W) in the message, and status-left or status-right. - Bump protocol version. From Tiago Cunha, thanks!
2009-07-15Return -1 not NULL on error, pointed out by Roy Marples.Nicholas Marriott
2009-07-13Tidy up and improve target (-t) argument parsing:Nicholas Marriott
- move the code back into cmd.c and merge with the existing functions where possible; - accept "-tttyp0" as well as "-t/dev/ttyp0" for clients; - when looking up session names, try an exact match first, and if that fails look for it as an fnmatch pattern and then as the start of a name - if more that one session matches an error is given; so if there is one session called "mysession", -tmysession, -tmysess, -tmysess* are equivalent but if there is also "mysession2", the last two are errors; - similarly for windows, if the argument is not a valid index or exact window name match, try it against the window names as an fnmatch pattern and a prefix.
2009-07-09New command, if-shell (alias if). Executes the tmux command in the secondNicholas Marriott
argument if the shell command in the first succeeds, for example: if "[ -e ~/.tmux.conf.alt ]" "source .tmux.conf.alt" Written by Tiago Cunha, many thanks.
2009-07-07Don't let ambiguous commands override an exact alias match: eg if commandsNicholas Marriott
"abc-1", "abc-2", "abc-3" exist and "abc-3" has the alias "abc", "tmux abc" should execute abc-3, not complain about the command being ambiguous. Not a problem at the moment but will be soon.
2009-06-04Print a better message than '(null)' if no command is specified ("tmux \;").Nicholas Marriott
2009-06-01Import tmux, a terminal multiplexor allowing (among other things) a singleNicholas Marriott
terminal to be switched between several different windows and programs displayed on one terminal be detached from one terminal and moved to another. ok deraadt pirofti