Commit Graph

61 Commits

Author SHA1 Message Date
nicm
1751da76d5 Remove unnecessary calls to va_start/va_end, from Tiago Cunha. 2014-01-09 13:46:12 +00:00
nicm
282c5f9644 Alter how tmux handles the working directory to internally use file
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-10 12:26:34 +00:00
nicm
a0404b6902 retcode -> retval for exit message. 2013-10-10 12:12:54 +00:00
nicm
b822d24b15 Support -c for new-session, based on code from J Raynor. 2013-10-10 12:07:36 +00:00
nicm
4c9f41f1ad Pass flags into cmdq_guard as an argument since sometimes cmdq->cmd can
be NULL. Avoids crash when a command in a command client can't be
parsed.
2013-10-10 11:45:28 +00:00
Nicholas Marriott
662d471215 Mark control commands specially so the client can identify them, based
on a diff from George Nachman a while back.
2013-06-23 12:41:54 +00:00
Nicholas Marriott
7ada64d5f8 Fix bug where end guard in control mode was not printed after session
destroyed, from George Nachman.
2013-04-10 12:15:36 +00:00
Nicholas Marriott
771d7db3a6 Fix compiler warnings, missing #include. From Thomas Adam. 2013-03-26 10:54:48 +00:00
Nicholas Marriott
0ef24f9912 Only send end guard if begin was sent, from George Nachman. 2013-03-25 11:41:16 +00:00
Nicholas Marriott
ebd9c615c8 Add some additional debug logging. 2013-03-25 10:06:13 +00:00
Nicholas Marriott
20636d956d Add a command queue to standardize and simplify commands that call other
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-24 09:54:10 +00:00