Commit Graph

155 Commits

Author SHA1 Message Date
Thomas Adam
72e9ebf2ec Merge branch 'obsd-master' 2015-04-25 20:45:02 +00:00
nicm
6dbd63ba4f Move the functions to convert ids from strings into session.c and window.c. 2015-04-25 18:09:28 +00:00
Thomas Adam
56e1132db4 Merge branch 'obsd-master' 2015-04-25 10:02:46 +00:00
nicm
9a453dd354 Make session_has return a flag, returning the first winlink found is a
recipe for errors.
2015-04-22 15:32:33 +00:00
Nicholas Marriott
747cab4281 No need for $Id$ now. 2014-11-08 12:27:43 +00:00
Thomas Adam
35ffd093d7 Merge branch 'obsd-master'
Conflicts:
	Makefile
	cmd-link-window.c
	cmd-unlink-window.c
2014-10-29 12:51:21 +00:00
nicm
abfb9656ef Fix some spacing nits. 2014-10-22 23:18:53 +00:00
nicm
68cb1c0e6b Merge unlink-window into kill-window. 2014-10-22 23:11:41 +00:00
Thomas Adam
bae95844d7 Merge branch 'obsd-master'
Conflicts:
	format.c
	window.c
2014-05-13 21:58:48 +01:00
nicm
b3e8d440ed If multiple arguments are given to new-session, new-window,
split-window, respawn-window or respawn-pane, pass them directly to
execvp() to help avoid quoting problems. One argument still goes to "sh
-c" like before. Requested by many over the years. Patch from J Raynor.
2014-05-13 08:08:32 +00:00
Thomas Adam
953c3ef47a Merge branch 'obsd-master'
Conflicts:
	Makefile
	tmux.1
	window.c
2014-04-23 11:26:11 +01:00
nicm
3e27be353d Set PATH explicitly, either from client or session
environment. Previously it came from the session environment. From J
Raynor.
2014-04-17 13:02:59 +00:00
Thomas Adam
d50e47fc4a Merge branch 'obsd-master'
Conflicts:
	Makefile
	cmd-server-info.c
	cmd-start-server.c
2014-01-31 21:39:56 +00:00
nicm
9ee93b3ea3 Do not permit periods in session names (colons are already banned). From
J Raynor.
2014-01-22 14:00:08 +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
34674bb180 Renumber windows: Lookup lastw via window not index
When calling 'movew -r' on a session to reorder the winlinks, ensure
when adding back in the information for the lastw stack that we look up
the winlink based on the window and not its index.

Using the index doesn't make sense here because when comparing it to the
old set, it will never match since the winlink has been renumbered.

Bug reported by Ben Boeckel. Patch by Thomas Adam.
2013-10-10 11:58:24 +00:00
nicm
d3830e622f Grouped sessions were being leaked on destroy, correctly free them. 2013-10-10 11:46:28 +00:00
Nicholas Marriott
4538c269d0 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 '#{pane_current_path}'

The equivalent of default-path '~' is left as an exercise for the reader.

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-06 21:02:23 +01:00
Thomas Adam
5532766b19 Renumber windows: Lookup lastw via window not index
When calling 'movew -r' on a session to reorder the winlinks, ensure when
adding back in the information for the lastw stack that we look up the
winlink based on the window and not its index.

Using the index doesn't make sense here because when comparing it to the old
set, it will never match since the winlink has been renumbered.

Bug reported by Ben Boeckel.
2013-08-20 00:04:07 +01:00
Nicholas Marriott
b0b5cad496 Grouped sessions were being leaked on destroy, correctly free them. 2013-08-01 23:38:35 +01:00
Nicholas Marriott
6fee3e9e4b Rename session idx to session id throughout and add $ prefix to targets
to use it, extended from a diff from George Nachman.
2013-03-25 10:11:45 +00:00
Nicholas Marriott
eaaeb28cda Add session_set_current helper function, extracted from a diff from
Aaron Jensen.
2013-03-22 16:00:26 +00:00
Nicholas Marriott
f47a063841 Rename session idx to session id throughout and add $ prefix to targets to use
it, extended from a diff from George Nachman.
2013-03-07 10:07:22 +00:00
Nicholas Marriott
8c50f625b0 Add session_set_current helper function, extracted from a diff from Aaron
Jensen.
2013-02-21 16:54:13 +00:00
Tiago Cunha
a432fcd306 Sync OpenBSD patchset 1150:
xfree is not particularly helpful, remove it. From Thomas Adam.
2012-07-11 19:34:16 +00:00
Tiago Cunha
38530de622 Sync OpenBSD patchset 1144:
Clear flags across all sessions, from Thomas Adam.
2012-07-11 17:06:11 +00:00
Nicholas Marriott
df912e3540 xfree is not particularly helpful, remove it. From Thomas Adam. 2012-07-10 11:53:01 +00:00
Nicholas Marriott
63f5c38023 Clear flags across all sessions, from Thomas Adam. 2012-07-08 07:27:32 +00:00
Tiago Cunha
b728970c65 Sync OpenBSD patchset 1104:
Add a flag to move-window to renumber the windows in a session (closing
any gaps) and add an option to do this automatically each time a window
is killed. From Thomas Adam.
2012-05-03 17:51:04 +00:00
Nicholas Marriott
a6c22d650b Add a flag to move-window to renumber the windows in a session (closing
any gaps) and add an option to do this automatically each time a window
is killed. From Thomas Adam.
2012-04-29 17:20:01 +00:00
Tiago Cunha
f41efd9d89 Sync OpenBSD patchset 1069:
Add notify hooks for various events, the functions are currently empty
stubs but will be filled in for control mode later. From George Nachman.
2012-03-18 02:22:09 +00:00
Nicholas Marriott
46210344a6 Add notify hooks for various events, the functions are currently empty
stubs but will be filled in for control mode later. From George Nachman.
2012-03-17 22:35:09 +00:00
Tiago Cunha
b9bbe1d81c Sync OpenBSD patchset 943:
Correctly skip existing numbers when generating the name for a new
session.
2011-08-21 12:35:47 +00:00
Nicholas Marriott
6b734d1074 Correctly skip existing numbers when generating the name for a new
session.
2011-08-16 09:36:23 +00:00
Tiago Cunha
391f1f08c0 Expand the Id keyword. 2011-07-09 09:42:33 +00:00
Nicholas Marriott
e5f4bf3f3e |PatchSet 884
|Date: 2011/04/06 22:51:31
|Author: nicm
|Branch: HEAD
|Tag: (none)
|Log:
|Change so that an empty session name always means the current sessions
|even if given with, for example, -t '', and explicitly forbid empty
|session names and those containing a : when they are created.
2011-04-06 22:29:26 +00:00
Nicholas Marriott
ec89eb9552 Change so that an empty session name always means the current sessions
even if given with, for example, -t '', and explicitly forbid empty
session names and those containing a : when they are created.
2011-04-06 21:51:31 +00:00
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
Nicholas Marriott
1270f8fed8 Check if the index is in use and fail before creating the child process,
rather than leaving a stray child on failure.
2011-01-25 22:31:50 +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
Nicholas Marriott
2d82567070 Er, fix next and previous session functions to actually work, part 2. 2011-01-13 02:08:14 +00:00
Nicholas Marriott
588ebb5393 Fix next and previous session functions to actually work. 2011-01-13 02:07:06 +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
Nicholas Marriott
04b32fa734 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-01 01:12:09 +00:00
Nicholas Marriott
cc42614fa9 Change from a per-session stack of buffers to one global stack which is
much more convenient and also simplifies lot of code. This renders
copy-buffer useless and makes buffer-limit now a server option.

By Tiago Cunha.
2010-12-30 23:16:18 +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