| Commit message (Collapse) | Author | Age |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
to a different poll loop):
If a MSG_READY was followed very quickly by a MSG_EXIT (for example if doing
"tmux new 'exit'"), both messages could be read as part of the same imsg_read
in the first client poll loop. The MSG_READY would then cause a switch to the
second client loop, which would immediately call poll(2) again, causing the
client to hang forever waiting for an exit message that it already had.
Change to call imsg_get to process any existing messages before polling.
|
| |
| |
| |
| |
| |
| | |
use the error and exit on MSG_EXIT (it was being handled in the default
case). Undo the last change, move the errstr check into the MSG_EXIT case, and
add a comment.
|
| | |
|
| |
| |
| |
| |
| |
| | |
the parent, otherwise TIOCGWINSZ will fail when the window is resized (that
could actually be moved into the server but this is more future-proof and
avoids breaking the protocol).
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
lookup table and use a switch, merge the tiny handler functions into it, and
move the whole lot to client.c.
Also change client_msg_dispatch to consume as many messages as possible and
move the call to it to the right place so it checks for signals afterwards.
Prompted by suggestions from eric@.
|
| |
| |
| |
| | |
properly, rather than just exiting.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
void.
Also remove a leftover variable in client.c.
|
| |
| |
| |
| | |
error string into struct client_ctx as well.
|
| |
| |
| |
| | |
variable. Only one flag now but more to come later.
|
| | |
|
| |
| |
| |
| | |
easier to match client to server in ps/pgrep when using several servers.
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| | |
it, extended from a diff from George Nachman.
|
|/
|
|
| |
ready.
|
|
|
|
| |
from George Nachman..
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
sent to stdin before it is needed, which can be inconvenient (eg pasting
commands). Instead, start with stdin disabled and reuse MSG_STDIN from
server->client to mean that stdin should be enabled. Based on a diff
from Chris Johnsen.
|
|
|
|
|
| |
Change a log to fprintf that was missed last time around, from Tiago Cunha.
|
|
|
|
|
| |
xfree is not particularly helpful, remove it. From Thomas Adam.
|
| |
|
|
|
|
|
| |
Actually write all the data to stdout/stderr.
|
|
|
|
|
|
|
|
|
| |
Add a skeleton mode to tmux (called "control mode") that let's tmux
commands be sent and output received on stdout. This can be used to
integrate with other terminal emulators and should allow some other
things to be made simpler later. More to come so doesn't do much yet and
deliberately not documented.
|
|
|
|
|
| |
Simplify logging and just fprintf(stderr, ...) for early errors.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of passing stdin/stdout/stderr file descriptors over imsg and
handling them in the server, handle them in the client and pass buffers
over imsg. This is much tidier for some upcoming changes and the
performance hit isn't critical.
The tty fd is still passed to the server as before.
This bumps the tmux protocol version so new clients and old servers are
incompatible.
|
|
|
|
|
| |
Add missing prototype.
|
|
|
|
|
| |
Use an enum for client exit reasons, from George Nachman.
|
|
|
|
|
| |
Add sys/file.h.
|
|
|
|
|
|
| |
Move MSG_IDENTIFY to the last sent by the client, this will be needed by
control clients and irrelevant for others.
|
|
|
|
|
|
|
| |
Use a lock file and flock() to serialize server start, avoids problems
when running a bunch of tmux from cron at the same time. Based on a diff
from Tim Ruehsen.
|
| |
|
|
|
|
|
|
| |
Add a -P option to detach to HUP the client's parent process (usually
causing it to exit as well).
|
|
|
|
|
|
|
| |
Move all calls to fcntl(...O_NONBLOCK) into a function and clear the
flag on the stdio file descriptors before closing them (fixes things
like "tmux ls && cat").
|
| |
|
|
|
|
|
|
| |
Merge the before and after attach client code into one in client.c
(instead of two in tmux.c and client.c).
|
|
|
|
|
|
| |
Trying to set FD_CLOEXEC on every fd is a lost cause, just use
closefrom() before exec.
|
|
|
|
|
|
| |
Can't call event_del() without event_set() first - so call event_set()
when setting up the client.
|
|
|
|
|
|
| |
MSG_EXIT can now have a return code in the message, so check for that
size as well. Stops the client fatal()ing on exit.
|
|
|
|
|
|
|
|
|
|
| |
Send all three of stdin, stdout, stderr from the client to the server, so that
commands can directly make use of them. This means that load-buffer and
save-buffer can have "-" as the file to read from stdin or write to stdout.
This is a protocol version bump so the tmux server will need to be restarted
after upgrade (or an older client used).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix problems with window sizing seen by Raghavendra D Prabhu when
starting tmux from .xinitrc.
One of the very few things the server relies on the client for now is to
pass through a message on SIGWINCH, but there is a condition where
potentially a SIGWINCH may be lost during the transition from unattached
(main.c) to attached (client.c). So trigger a size change immediately
after the client installs its SIGWINCH handler.
Also, when the terminal is resized, reset the scroll region and cursor
position. Previously, we were clearing our saved idea of these, but in
fact some terminals do not reset them on resize, so this caused problems
during redraw.
While here make a resize to the same size not cause a redraw and rename
the tmux.out output log file to include the tmux PID.
|
|
|
|
|
|
| |
This ioctl(TIOCGWINSZ) call is no longer necessary, the result is never
used and the server now does it later on the tty fd directly.
|
|
|
|
|
|
|
|
|
| |
Catch SIGHUP and terminate if running as a client. This prevents clients
from being left hanging around when, for example, a SSH session is
disconnected.
ok nicm@
|
|
|
|
|
|
|
| |
Make signal handler setup/teardown two common functions instead of six,
and reset SIGCHLD after fork to fix problems with some shells. From
Romain Francoise.
|
|
|
|
|
|
|
| |
Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last
time now I've configured emacs to make them displayed in really annoying
colours...
|