Commit Graph

15 Commits (a910b38a353d73bf581900a6b117406020dbf2d9)

Author SHA1 Message Date
Nicholas Marriott 43cd40e87a 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-23 16:45:00 +00:00
Nicholas Marriott 7a005b91b3 If the client passes zero for the window size in the identify message (which it
can, for example on serial terminals), reset it to 80x25, same as for resize
messages. Problem reported by kettenis@.
2009-08-13 12:15:45 +00:00
Nicholas Marriott 4310282a4c Have the client pass its stdin fd to the server when identifying itself and
have the server use that rather than reopening the tty. If the fd isn't given,
use the old behaviour (so no need for a version change).

This allows tmux to be used as the shell, so also change so that when working
out the command to execute if default-command is empty (the default), tmux will
try not execute itself.
2009-08-11 21:28:11 +00:00
Nicholas Marriott ff65e37545 Drop the no_stop argument to tty_close and tty_free in favour of a flag in the
tty struct.
2009-08-11 19:32:25 +00:00
Nicholas Marriott f0635717b3 Switch tmux to use imsg. This is the last major change to make the
client-server protocol more resilient and make the protocol versioning work
properly. In future, the only things requiring a protocol version bump will be
changes in the message structs, and (when both client and server have this
change) mixing different versions should nicely report an error message.

As a side effect this also makes the code tidier, fixes a problem with the way
errors reported during server startup were handled, and supports fd passing
(which will be used in future).

Looked over by eric@, thanks.

Please note that mixing a client with this change with an older server or vice
versa may cause tmux to crash or hang - tmux should be completely exited before
upgrading.
2009-08-11 17:18:35 +00:00
Nicholas Marriott 6491274f60 Infrastructure and commands to manage the environment for processes started
within tmux.

There is a global environment, copied from the external environment when the
server is started and each sesssion has an (initially empty) session
environment which overrides it.

New commands set-environment and show-environment manipulate or display the
environments.

A new session option, update-environment, is a space-separated list of
variables which are updated from the external environment into the session
environment every time a new session is created - the default is DISPLAY.
2009-08-08 21:52:43 +00:00
Nicholas Marriott 9f1dd4d0af Similar changes for server_msg_dispatch: use a switch instead of a lookup table
and merge smaller functions inline.
2009-07-30 16:40:12 +00:00
Nicholas Marriott c1d6d7ac6b Rename struct hdrtype to msgtype which is a better name and can be used even
when struct hdr disappears.
2009-07-29 14:17:26 +00:00
Nicholas Marriott 34a82e7629 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-26 12:58:44 +00:00
Nicholas Marriott 4a04b498db None of the server message functions return anything but 0, so make them all
void.

Also remove a leftover variable in client.c.
2009-07-23 21:19:11 +00:00
Nicholas Marriott 474fdebb7a Handle empty or unset TERM correctly; also fix a fatal() message while here. 2009-07-07 17:24:32 +00:00
Nicholas Marriott 9ced016cbc When sending a "protocol mismatch" error message, tell the client to exit
afterwards, otherwise it hangs.
2009-07-07 12:34:47 +00:00
Nicholas Marriott 89262c62fe Terminate cwd buffer before running xstrdup on it. 2009-06-05 11:14:13 +00:00
Nicholas Marriott 50bd094856 If the prompt is hidden or a password is sent with -U, zero it before freeing
it.
2009-06-04 21:43:24 +00:00
Nicholas Marriott 35876eaab9 Import tmux, a terminal multiplexor allowing (among other things) a single
terminal to be switched between several different windows and programs
displayed on one terminal be detached from one terminal and moved to another.

ok deraadt pirofti
2009-06-01 22:58:49 +00:00