Commit Graph

88 Commits

Author SHA1 Message Date
Tiago Cunha
4e4568cade Sync OpenBSD patchset 852:
Check if the index is in use and fail before creating the child process,
rather than leaving a stray child on failure.
2011-02-15 15:09:52 +00:00
Tiago Cunha
3866988f87 Sync OpenBSD patchset 841:
Er, fix next and previous session functions to actually work, part 2.
2011-01-21 23:53:01 +00:00
Tiago Cunha
43f8d62f6a Sync OpenBSD patchset 840:
Fix next and previous session functions to actually work.
2011-01-21 23:52:36 +00:00
Tiago Cunha
d3c04b74ec Sync OpenBSD patchset 819:
Don't reset the activity timer for unattached sessions every second,
this screws up the choice of most-recently-used. Instead, break the time
update into a little function and do it when the session is attached.

Pointed out by joshe@.
2011-01-03 23:27:54 +00:00
Tiago Cunha
9ebee6aef8 Global paste buffers instead of per-session which renders copy-buffer useless.
As a consequence buffer-limit is now a server option.
2010-12-30 22:39:49 +00:00
Tiago Cunha
a373235106 Sync OpenBSD patchset 806:
Store sessions in an RB tree by name rather than a list, this is tidier
and allows them to easily be shown sorted in various lists
(list-sessions/choose-sessions).

Keep a session index which is used in a couple of places internally but
make it an ever-increasing number rather than filling in gaps with new
sessions.
2010-12-22 15:36:44 +00:00
Tiago Cunha
9f3399da00 Sync OpenBSD patchset 805:
Fix another stray addition that was too early. Oops.
2010-12-22 15:33:14 +00:00
Tiago Cunha
c05a47ad0d Sync OpenBSD patchset 804:
Undo a change to next/previous session that got mixed in prematurely.
2010-12-22 15:32:40 +00:00
Tiago Cunha
a932742a8a Sync OpenBSD patchset 803:
Dead sessions are never on the active sessions list, so the SESSION_DEAD
flag is effectively unused. Remove it.
2010-12-22 15:31:56 +00:00
Tiago Cunha
64d16cf2d6 Sync OpenBSD patchset 801:
Unify the way sessions are used by callbacks - store the address and use
the reference count, then check it is still on the global sessions list
in the callback.
2010-12-22 15:28:51 +00:00
Tiago Cunha
89c07dedd9 Sync OpenBSD patchset 759:
Add -n and -p flags to switch-client to move to the next and previous
session (yes, it doesn't match window/pane, but so what, nor does
switch-client).

Based on a diff long ago from "edsouza".
2010-09-10 13:36:17 +00:00
Tiago Cunha
63e76b555d Sync OpenBSD patchset 730:
Store the current working directory in the session, change the default-path
option to default to empty and make that mean that the stored session CWD is
used.
2010-07-02 02:49:19 +00:00
Tiago Cunha
47b335dee7 Sync OpenBSD patchset 724:
Having a list of winlinks->alerts for each session is stupid, just store
the alert flags directly in the winlink itself.
2010-06-22 23:26:18 +00:00
Tiago Cunha
6c76724201 Sync OpenBSD patchset 723:
Rename activity->alert in a couple of functions for consistency.
2010-06-22 23:22:31 +00:00
Tiago Cunha
f81b3ddf94 Sync OpenBSD patchset 591:
Fix a couple of problems with grouped sessions reported by danh: redraw
properly and choose the correct last window after a window is killed.
2009-12-26 23:45:21 +00:00
Tiago Cunha
cc094fdfe6 Sync OpenBSD patchset 581:
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...
2009-12-04 22:14:47 +00:00
Tiago Cunha
c12e0b0708 Sync OpenBSD patchset 567:
Remove a couple of unused arguments where possible, and add /* ARGSUSED */ to
the rest to reduce lint output.
2009-11-28 14:50:37 +00:00
Tiago Cunha
56447d73c1 Sync OpenBSD patchset 534:
Use winlink_remove() to remove old winlinks when synchronizing grouped sessions
rather than doing it manually and not adjusted the reference count. Fixes
crash seen by Dan Harnett.
2009-11-13 16:59:19 +00:00
Tiago Cunha
bbad75fb6c Sync OpenBSD patchset 483:
Change session and client activity and creation time members to have more
meaningful names.

Also, remove the code to try and update the session activity time for the
command client when a command message is received as is pointless because it
des not have a session.
2009-11-04 22:42:31 +00:00
Tiago Cunha
6a1ebb11df Sync OpenBSD patchset 371:
Add "grouped sessions" which have independent name, options, current window and
so on but where the linked windows are synchronized (ie creating, killing
windows and so on are mirrored between the sessions). A grouped session may be
created by passing -t to new-session.

Had this around for a while, tested by a couple of people.
2009-10-11 23:38:16 +00:00
Tiago Cunha
91e4dc83fc Sync OpenBSD patchset 370:
Support for individual session idle time locking. May be enabled by turning off
the lock-server option (it is on by default). When this is off, each session
locks when it has been idle for the lock-after-time setting. When on, the
entire server locks when ALL sessions have been idle for their individual
lock-after-time settings.

This replaces one global-only option (lock-after-time) with another
(lock-server), but the default behaviour is usually preferable so there don't
seem to be many alternatives.

Diff/idea largely from Thomas Adam, tweaked by me.
2009-10-11 23:30:28 +00:00
Tiago Cunha
3266fb5441 Sync OpenBSD patchset 332:
Regularise some fatal messages.
2009-09-20 22:11:27 +00:00
Nicholas Marriott
15b643fc11 Sync from OpenBSD:
==
Rather than constructing an entire termios struct from ttydefaults.h, just let
forkpty do it and then alter the bits that should be changed after fork. A
little neater and more portable.
==

This should fix problems caused by glibc's broken ttydefaults.h file.
2009-09-16 12:36:28 +00:00
Tiago Cunha
930f67f474 Sync OpenBSD patchset 320:
Reference count clients and sessions rather than relying on a saved index for
cmd-choose-*.
2009-09-07 23:59:19 +00:00
Tiago Cunha
521659db4b Adjust OpenBSD patchset 305 to the portable version. 2009-09-02 01:05:55 +00:00
Tiago Cunha
a3a150faf2 Sync OpenBSD patchset 305:
When using tmux as a login shell, there is currently no way to specify a shell
to be used as a login shell inside tmux, so add a default-shell session option.
This sets the shell invoked as a login shell when the default-command option is
empty.

The default option value is whichever of $SHELL, getpwuid(getuid())'s pw_shell
or /bin/sh is valid first.

Based on a diff from martynas@, changed by me to be a session option rather
than a window option.
2009-09-02 01:02:44 +00:00
Tiago Cunha
e61ee94e26 Sync OpenBSD patchset 257:
Add a base-index session option to specify the first index checked when looking
for an index for a new window.
2009-08-16 19:16:27 +00:00
Tiago Cunha
f415d43c3b Sync OpenBSD patchset 254:
When creating a new session from the command-line where there is an external
terminal, copy the termios(4) special characters and use them for new windows
created in the new session. Suggested by Theo.
2009-08-16 18:59:12 +00:00
Tiago Cunha
29b1b2fb5e Sync OpenBSD patchset 231:
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 session 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-09 17:48:55 +00:00
Nicholas Marriott
2ddcb51df3 Fix $Id$. 2009-07-08 18:03:03 +00:00
Nicholas Marriott
86504af149 Rename the global options variables to be shorter and to make session options
clear. No functional change, getting this out of the way to make later options
changes easier.
2009-07-08 18:01:31 +00:00
Tiago Cunha
80af85a102 - New window option monitor-content to search for a string in a window, and
highlight the status line if it matches.
- To make this possible, the function cmd_find_window_search from
  cmd-find-window.c had to be moved to window.c and renamed window_pane_search.
- While there use three new functions in server.c to check for bell, activity,
  and content, to avoid too much nesting.
2009-05-19 13:32:55 +00:00
Nicholas Marriott
143aa718e5 Space trimmage mega-diff. 2009-05-04 17:58:27 +00:00
Nicholas Marriott
f5f04a9344 * New session flag "set-remain-on-exit" to set remain-on-exit flag for new windows created in that session (like "remain-by-default" used to do). Not perfectly happy about this, but until I can think of a good way to introduce it generically (maybe a set of options in the session) this will do. Fixes SF request 2527847. 2009-03-21 12:44:06 +00:00
Nicholas Marriott
521fa7d640 Unused variable. 2009-03-07 10:11:20 +00:00
Nicholas Marriott
65b9aeb337 Put socket path in $TMUX. 2009-03-04 17:24:07 +00:00
Nicholas Marriott
4d9af27b0b Better error messages for fork. 2009-01-23 16:59:14 +00:00
Nicholas Marriott
d1a5fde3d0 -a flags to next/previous window. 2009-01-18 18:31:45 +00:00
Nicholas Marriott
7cd3cf0ead Make the window pane code handle panes of different sizes, and add a -l and -p arguments to split-window to specify the new window size in lines or as a percentage. 2009-01-12 18:22:47 +00:00
Nicholas Marriott
4d71164826 Pick up cwd from environment,. 2009-01-10 19:37:35 +00:00
Nicholas Marriott
fd05d07c2b Change server-info format. 2009-01-10 14:43:43 +00:00
Nicholas Marriott
7a82e86827 Make window options work the same was as session options, add mode-fg/mode-bg options, force -g for global on set/show/setw/showw/ 2008-12-08 16:19:51 +00:00
Nicholas Marriott
5ca710d9e3 Disable UTF-8 by default and add options to enable it. 2008-11-16 13:28:59 +00:00
Nicholas Marriott
46f5e42145 Keep stack of previous windows.
Check for op (orig_pair) for default colours.
2008-11-16 10:10:26 +00:00
Nicholas Marriott
4198a9c376 TAILQ -> SLIST. 2008-11-05 01:19:24 +00:00
Nicholas Marriott
62457bce0b Trim. 2008-09-26 06:45:28 +00:00
Nicholas Marriott
33aa931541 Support OS X by moving to gettimeofday(2) and adding poll compat from OpenSSH. 2008-08-28 17:45:30 +00:00
Nicholas Marriott
ce2dc2a66a Set up environ properly. 2008-06-30 19:11:33 +00:00
Nicholas Marriott
d90d646ca8 Zombie windows, requested by Will Maier. 2008-06-29 07:04:31 +00:00
Nicholas Marriott
9798dcd4df Start of improved buffer code. Only set-buffer/show-buffer commands so far. 2008-06-20 08:36:20 +00:00