summaryrefslogtreecommitdiffstats
path: root/cmd-command-prompt.c
AgeCommit message (Collapse)Author
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 :%%".
2009-11-14Sync OpenBSD patchset 539:Tiago Cunha
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.
2009-09-22Sync OpenBSD patchset 342:Tiago Cunha
Use KEYC_NONE constant instead of 0 on init.
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-20Sync OpenBSD patchset 276:Tiago Cunha
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.
2009-08-16Sync OpenBSD patchset 261:Tiago Cunha
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.
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-20Sync OpenBSD patchset 145:Tiago Cunha
Kill some dead stores and fix a null pointer deref, found by clang.
2009-07-17Memory could be leaked if a second prompt or message appeared while another wasNicholas Marriott
still present, so add a separate prompt free callback and make the _clear function responsible for calling it if necessary (rather than the individual
2009-07-15Make status_message_set a variadic printf-like function. No functional change -Nicholas Marriott
helpful for a couple of things coming soon.
2009-07-14Having fixed flags for single-character getopt options is a bit hard toNicholas Marriott
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.
2009-02-16And another memory leak.Nicholas Marriott
2009-02-16Memory leak.Nicholas Marriott
2009-02-13Move status prompt/message init and teardown into status.c.Nicholas Marriott
2009-01-30move-window bound to ., from joshe.Nicholas Marriott
2009-01-19Pass return code from _exec; allow command sequences to work from the ↵Nicholas Marriott
command line.
2009-01-18find-window command.Nicholas Marriott
2009-01-18Support command sequences separated by " ; ". Also clean up command printing.Nicholas Marriott
2009-01-14Rename some flags I'm not happy about.Nicholas Marriott
2009-01-13command-prompt now accepts a single argument, a template string. Any ↵Nicholas Marriott
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 %%'"
2009-01-11Server locking. set-password and lock-server commands, plus automatic locking.Nicholas Marriott
2008-09-26Trim.Nicholas Marriott
2008-07-25Environment variables in configuration file.Nicholas Marriott
2008-06-25Oops, forgot to commit move-window. Also add select-prompt to allow index to ↵Nicholas Marriott
be typed.
2008-06-21Lose unnecessary flags on context.Nicholas Marriott
2008-06-19Handle commented lines.Nicholas Marriott
2008-06-19Command prompt for interactive commands.Nicholas Marriott