summaryrefslogtreecommitdiffstats
path: root/cmd.c
AgeCommit message (Collapse)Author
2011-04-06|PatchSet 884Nicholas Marriott
|Date: 2011/04/06 22:51:31 |Author: nicm |Branch: HEAD |Tag: (none) |Log: |Change so that an empty session name always means the current sessions |even if given with, for example, -t '', and explicitly forbid empty |session names and those containing a : when they are created.
2011-04-06|PatchSet 882Nicholas Marriott
|Date: 2011/04/05 20:37:01 |Author: nicm |Branch: HEAD |Tag: (none) |Log: |Add a flag to cmd_find_session so that attach-session can prefer |unattached sessions when choosing the most recently used (if -t is not |given). Suggested by claudio@.
2011-04-06PatchSet 870Nicholas Marriott
Date: 2011/03/27 21:27:26 Author: nicm Branch: HEAD Tag: (none) Log: Give each pane created in a tmux server a unique id (starting from 0), put it in the TMUX_PANE environment variable and accept it as a target. Suggested by and with testing and tweaks from Ben Boeckel.
2011-02-14Sync OpenBSD patchset 848:Tiago Cunha
Set $TMUX without the session when background jobs are run.
2011-01-07Sync OpenBSD patchset 829:Tiago Cunha
Clean up and simplify tmux command argument parsing. 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.
2010-12-30Global paste buffers instead of per-session which renders copy-buffer useless.Tiago Cunha
As a consequence buffer-limit is now a server option.
2010-12-22Sync OpenBSD patchset 806:Tiago Cunha
Store sessions in an RB tree by name rather than a list, this is tidier 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-12-06|---------------------Nicholas Marriott
|PatchSet 781 |Date: 2010/10/29 21:11:57 |Author: nicm |Branch: HEAD |Tag: (none) |Log: |We now send argv to the server after parsing it in the client to get the |command, so the client should not modify it. Instead, take a copy. Fixes |parsing command lists, reported by mcbride@. | |Members: | cmd-list.c:1.5->1.6 | cmd.c:1.45->1.46 | tmux.h:1.244->1.245
2010-10-24Sync OpenBSD patchset 780:Tiago Cunha
Add a last-pane command (bound to ; by default). Requested ages ago by somebody whose name I have forgotten.
2010-10-24Sync OpenBSD patchset 774:Tiago Cunha
Fall back on normal session choice method if $TMUX exists but is invalid rather than rejecting.
2010-07-17Sync OpenBSD patchset 735:Tiago Cunha
Make pane/window wrapping more logical (so with 10 windows, +10 from window 5 stays in the same place), and tidy the code. From Tiago Cunha.
2010-06-22Sync OpenBSD patchset 726:Tiago Cunha
Add a choose-buffer command for easier use of the paste buffer stack.
2010-06-22Sync OpenBSD patchset 725:Tiago Cunha
Extend the -t:+ and -t:- window targets for next and previous window to accept an offset such as -t:+2. From Tiago Cunha.
2010-05-14Sync OpenBSD patchset 697:Tiago Cunha
Identical behaviour to select-prompt can now be obtained with command-prompt, so remove select-prompt and change ' to be bound to command-prompt -p index "select-window -t :%%".
2010-03-15Support up, down, left, right movement through panes with -UDLR flags toNicholas Marriott
select-pane. Also remove up- and down-pane: equivalent behaviour is now available using -t :.+ and -t :.-.
2010-01-22Sync OpenBSD patchset 611:Tiago Cunha
Permit !, + and - to be used for window targets to specify last window (!), or next and previous window by number (+ and -). Also tidy an if in cmd-new-window.c.
2010-01-08Sync OpenBSD patchset 604:Tiago Cunha
New command, join-pane, to split and move an existing pane into the space (like splitw then movep, or the reverse of breakp).
2009-12-10Sync OpenBSD patchset 584:Tiago Cunha
Permit panes to be referred to as "top", "bottom", "top-left" etc, if the right pane can be identified.
2009-12-04Sync OpenBSD patchset 581:Tiago Cunha
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...
2009-12-02Sync OpenBSD patchset 577:Tiago Cunha
New command, capture-pane, which copies the entire pane contents to a paste buffer. From Jonathan Alvarado.
2009-11-22Sync OpenBSD patchset 559:Tiago Cunha
Use home from struct passwd if HOME is empty as well as if it is NULL, and fix a style nit. Both from Tiago Cunha.
2009-11-19Sync OpenBSD patchset 546:Tiago Cunha
Add a per-client log of status line messages displayed while that client 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-04Sync OpenBSD patchset 485:Tiago Cunha
Add an activity time for clients, like for sessions, and change session and 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-04Sync OpenBSD patchset 484:Tiago Cunha
If it isn't available explicitly, work out the current client in a similar way to the current session - build a list of the possibilities then pick the newest.
2009-11-04Sync OpenBSD patchset 483:Tiago Cunha
Change session and client activity and creation time members to have more 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-02Sync OpenBSD patchset 479:Tiago Cunha
When matching the session names with -t, look for exact matches first before 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-28Sync OpenBSD patchset 467:Tiago Cunha
tabs are better; ok nicm
2009-10-15Sync OpenBSD patchset 411:Tiago Cunha
cmd_find_client shouldn't die when there is an empty slot in the clients array. DOH.
2009-10-14Don't let cmd_lookup_client find clients w/o a session.Nicholas Marriott
2009-10-12Sync OpenBSD patchset 387:Tiago Cunha
Add a pipe-pane command to allow a pane to be piped to a shell command, for 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-12Sync OpenBSD patchset 377:Tiago Cunha
Split list-panes off from list-windows.
2009-10-07Sync OpenBSD patchset 364:Tiago Cunha
Fix comment.
2009-10-06Sync OpenBSD patchset 362:Tiago Cunha
Remove scroll mode which is now redundant, copy mode should be used instead. The = key binding now does nothing.
2009-10-06Sync OpenBSD patchset 360:Tiago Cunha
If no target client is specified to commands which accept one, try to guess the 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-25Sync OpenBSD patchset 353:Tiago Cunha
New lock-client and lock-session commands to lock an individual client or all clients attached to a session respectively.
2009-09-23Sync OpenBSD patchset 347:Tiago Cunha
Remove the internal tmux locking and instead detach each client and run the 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-20Sync OpenBSD patchset 335:Tiago Cunha
run-shell command to run a shell command without opening a window, sending stdout to output mode.
2009-08-31Sync OpenBSD patchset 302:Tiago Cunha
Add a new display-panes command, with two options (display-panes-colour and display-panes-time), which displays a visual indication of the number of each pane.
2009-08-25Sync OpenBSD patchset 294:Tiago Cunha
Add a choose-client command and extend choose-{session,window} to accept a 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-24Sync OpenBSD patchset 289:Tiago Cunha
The cursession member in struct cmd_ctx is always either curclient->session or NULL when curclient is also NULL, so just eliminate it.
2009-08-09Sync OpenBSD patchset 231:Tiago Cunha
Infrastructure and commands to manage the environment for processes started within tmux. There is a global environment, copied from the external environment when the server is started and each session 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-30Sync OpenBSD patchset 200:Tiago Cunha
Merge pane number into the target specification for pane commands. Instead of 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-30Sync OpenBSD patchset 197:Tiago Cunha
Add an additional heuristic to work out the current session when run from the 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-28Sync OpenBSD patchset 181:Tiago Cunha
Make all messages sent between the client and server fixed size. 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-25Sync OpenBSD patchset 178:Tiago Cunha
cmd_find_index should return -2 on error.
2009-07-23Sync OpenBSD patchset 164:Tiago Cunha
Tidy the target parsing code a bit and correct the behaviour so that as before 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-21No paths.h in cmd.c; add _PATH_DEV for Solaris.Nicholas Marriott
2009-07-17- New command display-message (alias display) to display a message in theTiago Cunha
status line (bound to "i" by default). - Add support for including the window index, pane index, and window name in status-left, or status-right. - Bump protocol version.
2009-07-17Changed the wrong thing here.Nicholas Marriott
2009-07-15Return -1 not NULL on error, pointed out by Roy Marples.Nicholas Marriott