summaryrefslogtreecommitdiffstats
path: root/cmd-pipe-pane.c
AgeCommit message (Collapse)Author
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.
2013-03-22No more lint means no more ARGSUSED.Nicholas Marriott
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.
2011-10-27Missing -o on usage for pipe-pane, from Tiago Cunha.Nicholas Marriott
2011-07-30Do not require a client here, or pipe-pane will not work from theNicholas Marriott
command line.
2011-03-29Change -t on display-message to be target-pane for the #[A-Z]Nicholas Marriott
replacements and add -c as target-client.
2011-01-08Move all calls to fcntl(...O_NONBLOCK) into a function and clear theNicholas Marriott
flag on the stdio file descriptors before closing them (fixes things like "tmux ls && cat").
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.
2010-10-16Trying to set FD_CLOEXEC on every fd is a lost cause, just useNicholas Marriott
closefrom() before exec.
2010-08-19Do not call event_del() for signals after fork(), just use sigaction()Nicholas Marriott
directly instead - calling libevent functions after fork() w/o event_reinit() is a bad idea, even if in this case it was harmless.
2010-06-14Last change erroneously used the target argument for looking up theNicholas Marriott
client which caused pipe-pane to fail when used from the command line. Instead pass NULL which should use the current client. Spotted by Tiago Cunha.
2010-06-05Support the status_replace # replacement sequences in the pipe-paneNicholas Marriott
command, thanks to Andrea Barisani.
2010-05-04Put this back in with the initialisation in the right order.Nicholas Marriott
2010-05-04Revert last change, it appears to be broken somehow.Nicholas Marriott
2010-05-03Make signal handler setup/teardown two common functions instead of six,Nicholas Marriott
and reset SIGCHLD after fork to fix problems with some shells. From Romain Francois.
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-11-26Remove a couple of unused arguments where possible, and add /* ARGSUSED */ toNicholas Marriott
the rest to reduce lint output.
2009-11-13Get rid of the ugly CMD_CHFLAG macro and use a const string (eg "dDU") in theNicholas Marriott
command entry structs and a couple of functions to check/set the flags.
2009-11-13Unreachable statement, found by lint.Nicholas Marriott
2009-11-04Convert the window pane (pty master side) fd over to use a bufferevent.Nicholas Marriott
The evbuffer API is very similar to the existing tmux buffer API so this was remarkably painless. Not many possible ways to do it, I suppose.
2009-11-04Switch window pane pipe redirect fd over to a bufferevent.Nicholas Marriott
2009-11-04Initial changes to move tmux to libevent.Nicholas Marriott
This moves the client-side loops are pretty much fully over to event-based only (tmux.c and client.c) but server-side (server.c and friends) treats libevent as a sort of clever poll, waking up after every event to run various things. Moving the server stuff over to bufferevents and timers and so on will come later.
2009-10-21Nuke dead store.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@.