summaryrefslogtreecommitdiffstats
path: root/cmd-queue.c
AgeCommit message (Collapse)Author
2016-09-28Couple of vasprintf -> xvasprintf.nicm
2016-04-29Final parts of command hooks, add before- and after- hooks to each command.nicm
2016-01-19Split out getting the current state from the target search so it can benicm
replaced if we already know the current.
2016-01-19I no longer use my SourceForge address so replace it.nicm
2015-12-16Add infrastructure to work out the best target given a pane or windownicm
alone and use it to add pane_died and pane_exited hooks.
2015-12-13If command returns error, report it.nicm
2015-12-13Instead of every command resolving the target (-t or -s) itself, preparenicm
the state (client, session, winlink, pane) for it it before entering the command. Each command provides some flags that tell the prepare step what it is expecting. This is a requirement for having hooks on commands (for example, if you hook "select-window -t1:2", the hook command should to operate on window 1:2 not whatever it thinks is the current window), and should allow some other target improvements. The old cmd_find_* functions remain for the moment but that layer will be dropped later. Joint work with Thomas Adam.
2015-11-27Do not set a limit on the length of commands when printing them.nicm
2015-11-14Push stdout and stderr to clients more aggressively, and add an event tonicm
continue if the send fails.
2015-11-12If we know the terminal outside tmux is not UTF-8, replace UTF-8 innicm
error messages and whatnot with underscores the same as we do when we draw UTF-8 characters as part of the screen.
2015-10-20Use client pointer not file descriptor in logging.nicm
2015-09-16Log when cmdq_continue is called.nicm
2015-09-16Rename cmd_q dead flag to a general flags bitmask (will be more flags later).nicm
2015-06-17Break cmdq_continue inner loop into a helper function.nicm
2015-04-19Rewrite of tmux mouse support which was a mess. Instead of havingnicm
options for "mouse-this" and "mouse-that", mouse events may be bound as keys and there is one option "mouse" that turns on mouse support entirely (set -g mouse on). See the new MOUSE SUPPORT section of the man page for description of the key names and new flags (-t= to specify the pane or window under mouse as a target, and send-keys -M to pass through a mouse event). The default builtin bindings for the mouse are: bind -n MouseDown1Pane select-pane -t=; send-keys -M bind -n MouseDown1Status select-window -t= bind -n MouseDrag1Pane copy-mode -M bind -n MouseDrag1Border resize-pane -M To get the effect of turning mode-mouse off, do: unbind -n MouseDrag1Pane unbind -temacs-copy MouseDrag1Pane The old mouse options are now gone, set-option -q may be used to suppress warnings if mixing configuration files.
2015-02-12Take a reference to prevent cmdq being freed during the command. Cannicm
happen to cfg_cmd_q (possibly others) when source-file recurses into cmdq_continue. Fixes bug reported by Ismail Donmez and Theo Buehler.
2015-02-05There is no need to save the guard state because the function checks itnicm
again anyway.
2014-10-27Move cfg_causes local into cfg.c and remove struct causelist.nicm
2014-10-21Save next item after firing command in case it has added to the queue.nicm
2014-10-20Better format for printf format attributes.nicm
2014-09-01Various minor style and spacing nits.nicm
2014-04-17Remove the "info" message mechanism, this was only used for about fivenicm
mostly useless and annoying messages. Change those commands to silence on success like all the others. Still accept the -q command line flag and "quiet" server option for now.
2014-01-09Remove unnecessary calls to va_start/va_end, from Tiago Cunha.nicm
2013-10-10Alter how tmux handles the working directory to internally use filenicm
descriptors rather than strings. - Each session still has a current working directory. - New sessions still get their working directory from the client that created them or its attached session if any. - New windows are created by default in the session working directory. - The -c flag to new, neww, splitw allows the working directory to be overridden. - The -c flag to attach let's the session working directory be changed. - The default-path option has been removed. To get the equivalent to default-path '.', do: bind c neww -c $PWD To get the equivalent of default-path '~', do: bind c neww -c ~ This also changes the client identify protocol to be a set of messages rather than one as well as some other changes that should make it easier to make backwards-compatible protocol changes in future.
2013-10-10retcode -> retval for exit message.nicm
2013-10-10Support -c for new-session, based on code from J Raynor.nicm
2013-10-10Pass flags into cmdq_guard as an argument since sometimes cmdq->cmd cannicm
be NULL. Avoids crash when a command in a command client can't be parsed.
2013-06-23Mark control commands specially so the client can identify them, basedNicholas Marriott
on a diff from George Nachman a while back.
2013-04-10Fix bug where end guard in control mode was not printed after sessionNicholas Marriott
destroyed, from George Nachman.
2013-03-26Fix compiler warnings, missing #include. From Thomas Adam.Nicholas Marriott
2013-03-25Only send end guard if begin was sent, from George Nachman.Nicholas Marriott
2013-03-25Add some additional debug logging.Nicholas Marriott
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.