aboutsummaryrefslogtreecommitdiff
path: root/cmd-command-prompt.c
Commit message (Collapse)AuthorAge
* Sync OpenBSD patchset 934:Tiago Cunha2011-07-08
| | | | | | | | Make confirm-before prompt customizable with -p option like command-prompt. Also move responsibility for calling status_replace into status_prompt_{set,update} and add #W and #P to the default kill-window and kill-pane prompts. By Tiago Cunha.
* Sync OpenBSD patchset 928:Tiago Cunha2011-07-04
| | | | | | Include the existing window and session name in the prompt when renaming and add a new key binding ($) for rename session. From Tiago Cunha.
* Sync OpenBSD patchset 927:Tiago Cunha2011-07-03
| | | | | | Allow the initial context on prompts to be set with the new -I option to command-prompt. From Tiago Cunha.
* Sync OpenBSD patchset 917:Tiago Cunha2011-05-22
| | | | | | | Pass prompts through status_replace so that they can be more helpful (such as showing the previous session name when renaming). From Tiago Cunha.
* Sync OpenBSD patchset 832:Tiago Cunha2011-01-07
| | | | | Whoops, command-prompt can take 0 or 1 argument.
* Sync OpenBSD patchset 829:Tiago Cunha2011-01-07
| | | | | | | | | | | | | | | | | | | | | | 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.
* Sync OpenBSD patchset 697:Tiago Cunha2010-05-14
| | | | | | | 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 :%%".
* Sync OpenBSD patchset 539:Tiago Cunha2009-11-14
| | | | | | Get rid of the ugly CMD_CHFLAG macro and use a const string (eg "dDU") in the command entry structs and a couple of functions to check/set the flags.
* Sync OpenBSD patchset 342:Tiago Cunha2009-09-22
| | | | | Use KEYC_NONE constant instead of 0 on init.
* Sync OpenBSD patchset 294:Tiago Cunha2009-08-25
| | | | | | | | | | | | | 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).
* Sync OpenBSD patchset 289:Tiago Cunha2009-08-24
| | | | | | The cursession member in struct cmd_ctx is always either curclient->session or NULL when curclient is also NULL, so just eliminate it.
* Sync OpenBSD patchset 276:Tiago Cunha2009-08-20
| | | | | | | | | | | | | | | | | | | | Extend command-prompt with a -p option which is a comma-separated list of one or more prompts to present in order. The responses to the prompt are replaced in the template string: %% are replaced in order, so the first prompt replaces the first %%, the second replaces the second, and so on. In addition, %1 up to %9 are replaced with the responses to the first the ninth prompts The default template is "%1" so the response to the first prompt is processed as a command. Note that this changes the behaviour for %% so if there is only one prompt, only the first %% will be replaced. Templates such as "neww -n '%%' 'ssh %%'" should be changed to "neww -n '%1' 'ssh %1'". From Tiago Cunha.
* Sync OpenBSD patchset 261:Tiago Cunha2009-08-16
| | | | | | | | | Switch the prompt code to return an empty string when the user enters no response and reserve NULL for an explicit cancel. Change all callbacks to treat them the same so no functional change. Also add cancel key bindings to emacs mode which were missing.
* Sync OpenBSD patchset 181:Tiago Cunha2009-07-28
| | | | | | | | | | | | | | | | | 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.
* Sync OpenBSD patchset 145:Tiago Cunha2009-07-20
| | | | | Kill some dead stores and fix a null pointer deref, found by clang.
* Memory could be leaked if a second prompt or message appeared while another wasNicholas Marriott2009-07-17
| | | | | | still present, so add a separate prompt free callback and make the _clear function responsible for calling it if necessary (rather than the individual
* Make status_message_set a variadic printf-like function. No functional change -Nicholas Marriott2009-07-15
| | | | | helpful for a couple of things coming soon.
* Having fixed flags for single-character getopt options is a bit hard toNicholas Marriott2009-07-14
| | | | | | | | | | maintain and is only going to get worse as more are used. So instead, add a new uint64_t member to cmd_entry which is a bitmask of upper and lowercase options accepted by the command. This means new single character options can be used without the need to add it explicitly to the list.
* And another memory leak.Nicholas Marriott2009-02-16
|
* Memory leak.Nicholas Marriott2009-02-16
|
* Move status prompt/message init and teardown into status.c.Nicholas Marriott2009-02-13
|
* move-window bound to ., from joshe.Nicholas Marriott2009-01-30
|
* Pass return code from _exec; allow command sequences to work from the ↵Nicholas Marriott2009-01-19
| | | | command line.
* find-window command.Nicholas Marriott2009-01-18
|
* Support command sequences separated by " ; ". Also clean up command printing.Nicholas Marriott2009-01-18
|
* Rename some flags I'm not happy about.Nicholas Marriott2009-01-14
|
* command-prompt now accepts a single argument, a template string. Any ↵Nicholas Marriott2009-01-13
| | | | | | | | | | | occurrences of %% in this string are replaced by whatever is entered at the prompt and the result is executed as a command. This allows things like (now bound by default): bind , command-prompt "rename-window %%" Or my favourite: bind x command-prompt "split-window 'man %%'"
* Server locking. set-password and lock-server commands, plus automatic locking.Nicholas Marriott2009-01-11
|
* Trim.Nicholas Marriott2008-09-26
|
* Environment variables in configuration file.Nicholas Marriott2008-07-25
|
* Oops, forgot to commit move-window. Also add select-prompt to allow index to ↵Nicholas Marriott2008-06-25
| | | | be typed.
* Lose unnecessary flags on context.Nicholas Marriott2008-06-21
|
* Handle commented lines.Nicholas Marriott2008-06-19
|
* Command prompt for interactive commands.Nicholas Marriott2008-06-19