Commit Graph

49 Commits

Author SHA1 Message Date
Nicholas Marriott
31407b70e0 Add option command-prefix which is automatically prepended to any command
(apart from a naked default-shell). The default is "exec ".
2013-02-22 14:31:38 +00:00
Nicholas Marriott
9d165df18a No more lint means no more ARGSUSED. 2013-02-17 23:15:38 +00:00
Thomas Adam
39631edb98 Merge branch 'obsd-master'
Sync from OpenBSD.
2012-11-27 18:12:04 +00:00
Nicholas Marriott
991bfcf443 Fix session choice so that preferring unattached sessions actually
works, reported by Drew Frank.
2012-11-27 09:20:03 +00:00
Tiago Cunha
56e37487a8 Sync OpenBSD patchset 1165:
Fix up window reference counting and don't crash if the rename timer
fires while the window is dead but still referenced. Fixes problem
reported by Michael Scholz.
2012-08-31 09:22:08 +00:00
Nicholas Marriott
58e8e0eac8 Fix up window reference counting and don't crash if the rename timer
fires while the window is dead but still referenced. Fixes problem
reported by Michael Scholz.
2012-08-21 10:00:33 +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
Nicholas Marriott
df912e3540 xfree is not particularly helpful, remove it. From Thomas Adam. 2012-07-10 11:53:01 +00:00
Tiago Cunha
e65c5ad56c Sync OpenBSD patchset 1093:
Turn automatic-rename off properly if turned off by renaming a
window. Reported by Romain Francoise.
2012-04-12 12:44:26 +00:00
Nicholas Marriott
c6e0af9bdb Turn automatic-rename off properly if turned off by renaming a
window. Reported by Romain Francoise.
2012-04-11 07:45:30 +00:00
Tiago Cunha
ce67a44a94 Sync OpenBSD patchset 1091:
Do not fire name timer when automatic-rename is off, from Tim Ruehsen a
while ago.
2012-04-10 09:57:08 +00:00
Nicholas Marriott
631d6b59fd Do not fire name timer when automatic-rename is off, from Tim Ruehsen a
while ago.
2012-04-08 06:47:26 +00:00
Tiago Cunha
0987d55231 Sync OpenBSD patchset 1057:
Check event_initialized before event_del if event may not have been set
up; libevent2 complains about this. Reported by Moriyoshi Koizumi.
2012-03-18 01:59:34 +00:00
Tiago Cunha
1fdac2adf1 Sync OpenBSD patchset 1044:
Add a missing call to window_set_name, from George Nachman.
2012-03-18 01:28:56 +00:00
Nicholas Marriott
d3c842d367 Check event_initialized before event_del if event may not have been set
up; libevent2 complains about this. Reported by Moriyoshi Koizumi.
2012-03-17 18:24:07 +00:00
Nicholas Marriott
be63fef872 Add a missing call to window_set_name, from George Nachman. 2012-03-09 21:11:28 +00:00
Tiago Cunha
391f1f08c0 Expand the Id keyword. 2011-07-09 09:42:33 +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
Nicholas Marriott
15a64b805e 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-03 22:50:09 +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
Nicholas Marriott
4ca857e0e9 Remove a couple of unused arguments where possible, and add /* ARGSUSED */ to
the rest to reduce lint output.
2009-11-26 21:37:13 +00:00
Tiago Cunha
81336d6bb0 Make it compile on the portable version. 2009-11-08 23:23:36 +00:00
Tiago Cunha
ab38d91913 Sync OpenBSD patchset 506:
Change window name change to use a timer event rather than a gettimeofday()
check every loop.
2009-11-08 23:22:24 +00:00
Nicholas Marriott
44d6a2c435 Change window name change to use a timer event rather than a gettimeofday()
check every loop.
2009-11-04 23:54:57 +00:00
Tiago Cunha
bc90c7c199 Sync OpenBSD patchset 375:
When a window is zombified and automatic-rename is on, append [dead] to the
name.
2009-10-12 00:03:04 +00:00
Nicholas Marriott
9ed62eeb91 When a window is zombified and automatic-rename is on, append [dead] to the
name.
2009-10-10 15:23:13 +00:00
Tiago Cunha
3266fb5441 Sync OpenBSD patchset 332:
Regularise some fatal messages.
2009-09-20 22:11:27 +00:00
Nicholas Marriott
273f1b385c Regularise some fatal messages. 2009-09-20 14:58:12 +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
Nicholas Marriott
7d5e494716 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-01 13:09:49 +00:00
Tiago Cunha
d3da62d53a Sync OpenBSD patchset 273:
Move another expensive options test to after a cheaper timer check/update.
2009-08-20 11:44:18 +00:00
Nicholas Marriott
11f0f812c5 Didn't mean to commit this stuff. 2009-08-19 09:04:48 +00:00
Nicholas Marriott
620402a833 This is a better fix for OS X stupidity. 2009-08-19 09:00:06 +00:00
Nicholas Marriott
8b7be5861e Move another expensive options test to after a cheaper timer check/update. 2009-08-18 21:18:20 +00:00
Nicholas Marriott
084d07f4eb Just appending -l to $SHELL to create a login shell is wrong: -l is not POSIX,
and some people may use shells which do not support it. Instead, make an empty
default-command option mean a login shell, and fork it with a - in argv[0]
which is the method used by login(1).

Also fix the automatic-rename code to handle this correctly and to strip a
leading - if present.
2009-07-08 05:26:45 +00:00
Nicholas Marriott
b8bd24817f If using the default login shell (empty default-command), strip any - prefix. 2009-07-02 18:26:55 +00:00
Nicholas Marriott
08c7249636 Change default_window_name to use window_default_command if the actual cmd is
empty. From Josh Elsasser.
2009-07-02 18:17:46 +00:00
Nicholas Marriott
8fc34ca044 libgen.h. 2009-06-25 16:49:02 +00:00
Nicholas Marriott
a9e3d5c56a More diff-to-OpenBSD reduction. Move a lot of compat stuff into compat.h. 2009-06-25 16:47:00 +00:00
Nicholas Marriott
a5830b9603 Restore $Id$ and add script to do so. 2009-06-25 16:21:32 +00:00
Nicholas Marriott
d3d4bacd82 Cast char to u_char before passing to isalnum(). By ray 2009-06-25 15:45:24 +00:00
Ray Lai
74749e8705 Remove trailing newlines, spaces, and tabs.
No binary change.
2009-06-05 03:13:16 +00:00
Ray Lai
fdda4142bf Cast char to u_char before passing to isalnum().
OK nicm@
2009-06-03 04:03:16 +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
Nicholas Marriott
143aa718e5 Space trimmage mega-diff. 2009-05-04 17:58:27 +00:00
Nicholas Marriott
cce03e138b Looking up argv[0] is expensive, so just use p_comm for the window name which is good enough. Also increase name update time to 500 ms. 2009-02-13 00:43:04 +00:00
Nicholas Marriott
c9cfc9a9f3 Don't try to change the window name unless the pid of the process chosen has
changed. Reduces CPU use.

osdep-* stuff is a bit horrible now but there we go :-/.
2009-02-09 18:08:01 +00:00
Nicholas Marriott
9cde0c2477 Be more clever about picking window name. 2009-01-26 22:57:20 +00:00
Nicholas Marriott
2d15f59859 Try to change the window title to match the command running it in. This is done
by reading argv[0] from the process group leader of the group that owns the tty
(tcgetpgrp()). This can't be done portably so some OS-dependent code is
introduced (ugh); OpenBSD, FreeBSD and Linux are supported at the moment.

A new window flag, automatic-rename, is available: if this is set to off, the
window name is not changed. Specifying a name with the new-window, new-session
or rename-window commands will automatically set this flag to off for the
window in question. To disable it entirely set the option to off globally (setw
-g automatic-rename off).
2009-01-20 19:35:03 +00:00