Permalink
Browse files

Imported Upstream version 1.3

  • Loading branch information...
1 parent dda8e8e commit fb53a63ddc8cd44b7eb993c0dd8b86df3cc8fec6 @kfebert kfebert committed Jul 23, 2010
Showing with 4,201 additions and 2,959 deletions.
  1. +1 −0 .pc/.quilt_patches
  2. +1 −0 .pc/.quilt_series
  3. +1 −0 .pc/.version
  4. +47 −1 CHANGES
  5. +8 −7 GNUmakefile
  6. +7 −6 Makefile
  7. +31 −14 TODO
  8. +2 −2 array.h
  9. +3 −3 attributes.c
  10. +2 −2 cfg.c
  11. +23 −31 client.c
  12. +12 −3 cmd-bind-key.c
  13. +146 −0 cmd-choose-buffer.c
  14. +6 −5 cmd-choose-window.c
  15. +5 −1 cmd-command-prompt.c
  16. +2 −1 cmd-copy-mode.c
  17. +0 −60 cmd-down-pane.c
  18. +5 −2 cmd-if-shell.c
  19. +5 −4 cmd-join-pane.c
  20. +2 −12 cmd-kill-session.c
  21. +6 −21 cmd-list-buffers.c
  22. +5 −1 cmd-list-windows.c
  23. +17 −9 cmd-list.c
  24. +26 −7 cmd-load-buffer.c
  25. +16 −7 cmd-new-session.c
  26. +42 −11 cmd-new-window.c
  27. +148 −26 cmd-paste-buffer.c
  28. +10 −3 cmd-pipe-pane.c
  29. +10 −2 cmd-run-shell.c
  30. +23 −12 cmd-save-buffer.c
  31. +13 −7 cmd-select-layout.c
  32. +39 −4 cmd-select-pane.c
  33. +0 −91 cmd-select-prompt.c
  34. +4 −3 cmd-send-keys.c
  35. +2 −2 cmd-send-prefix.c
  36. +5 −1 cmd-set-option.c
  37. +8 −5 cmd-split-window.c
  38. +0 −60 cmd-up-pane.c
  39. +123 −53 cmd.c
  40. +34 −9 compat.h
  41. +34 −34 compat/imsg-buffer.c
  42. +13 −13 compat/imsg.c
  43. +22 −22 compat/imsg.h
  44. +49 −0 compat/setenv.c
  45. +27 −8 configure
  46. +38 −2 environ.c
  47. +4 −3 examples/tmux.vim
  48. +1 −42 grid.c
  49. +1,140 −1,149 input.c
  50. +4 −3 job.c
  51. +18 −11 key-bindings.c
  52. +101 −115 key-string.c
  53. +264 −0 layout-custom.c
  54. +102 −1 layout-set.c
  55. +1 −2 layout-string.c
  56. +79 −51 layout.c
  57. +14 −1 mode-key.c
  58. +25 −1 paste.c
  59. +2 −2 resize.c
  60. +18 −31 screen-write.c
  61. +9 −3 screen.c
  62. +75 −28 server-client.c
  63. +43 −19 server-fn.c
  64. +31 −32 server-window.c
  65. +14 −83 server.c
  66. +30 −108 session.c
  67. +88 −0 signal.c
  68. +22 −50 status.c
  69. +270 −77 tmux.1
  70. +36 −92 tmux.c
  71. +113 −69 tmux.h
  72. +4 −3 tty-keys.c
  73. +44 −16 tty.c
  74. +5 −5 window-choose.c
  75. +3 −3 window-clock.c
  76. +364 −85 window-copy.c
  77. +0 −260 window-more.c
  78. +254 −47 window.c
View
@@ -0,0 +1 @@
+./debian/patches
View
@@ -0,0 +1 @@
+series
View
@@ -0,0 +1 @@
+2
View
@@ -1,3 +1,49 @@
+CHANGES FROM 1.2 TO 1.3, 18 July 2010
+
+* New input parser.
+* Flags to move through panes -UDLR added to select-pane.
+* Commands up-pane, and down-pane removed, since equivalent behaviour is now
+ available through the target flag (-t:+ and -t:-).
+* Jump-forward/backward in copy move (based on vi's F, and f commands).
+* Make paste-buffer accept a pane as a target.
+* Flag -a added to new-window to insert a window after an existing one, moving
+ windows up if necessary.
+* Merge more mode into copy mode.
+* Run job commands explicitly in the global environment (which can be modified
+ with setenv -g), rather than with the environment tmux started with.
+* Use the machine's hostname as the default title, instead of an empty string.
+* Prevent double free if the window option remain-on-exit is set.
+* Key string conversions rewritten.
+* Mark zombie windows as dead in the choose-window list.
+* Tiled layout added.
+* Signal handling reworked.
+* Reset SIGCHLD after fork to fix problems with some shells.
+* Select-prompt command removed. Therefore, bound ' to command-prompt -p index
+ "select-window -t:%%" by default.
+* Catch SIGHUP and terminate if running as a client, thus avoiding clients from
+ being left hanging around when, for instance, a SSH session is disconnected.
+* Solaris 9 fixes (such as adding compat {get,set}env(3) code).
+* Accept none instead of default for attributes.
+* Window options window-status-alert-{alert,bg,fg} added.
+* Flag -s added to the paste-buffer command to specify a custom separator.
+* Allow dragging to make a selection in copy mode if the mode-mouse option is
+ set.
+* Support the mouse scroll wheel.
+* Make pipe-pane accept special character sequences (eg #I).
+* Fix problems with window sizing when starting tmux from .xinitrc.
+* Give tmux sockets (but not the containing folder) group permissions.
+* Extend the target flags (ie -t) to accept an offset (for example -t:+2), and
+ make it wrap windows, and panes.
+* New command choose-buffer added.
+* New server option detach-on-destroy to set what happens to a client when the
+ session it is attached to is destroyed. If on (default), the client is
+ detached. Otherwise, the client is switched to the most recently active of
+ the remaining sessions.
+* The commands load-buffer, and save-buffer now accept a dash (-) as the file
+ to read from stdin, or write to stdout.
+* Custom layouts added.
+* Additional code reduction, bug fixes, and manpage enhancements.
+
CHANGES FROM 1.1 TO 1.2, 10 March 2010
* Switch to libevent.
@@ -1467,7 +1513,7 @@ The list of older changes is below.
(including mutt, emacs). No status bar yet and no key remapping or other
customisation.
-$Id: CHANGES,v 1.302 2010/03/10 15:18:11 tcunha Exp $
+$Id: CHANGES,v 1.303 2010/07/18 13:40:59 tcunha Exp $
LocalWords: showw utf UTF fulvio ciriaco joshe OSC APC gettime abc DEF OA clr
LocalWords: rivo nurges lscm Erdely eol smysession mysession ek dstname RB ms
View
@@ -1,4 +1,4 @@
-# $Id: GNUmakefile,v 1.122 2010/03/10 15:15:33 tcunha Exp $
+# $Id: GNUmakefile,v 1.128 2010/07/18 13:36:52 tcunha Exp $
#
# Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
#
@@ -17,7 +17,7 @@
.PHONY: clean
-VERSION= 1.2
+VERSION= 1.3
#FDEBUG= 1
@@ -28,7 +28,7 @@ LIBS+=
# Sun CC
ifneq ($(shell ($(CC) -V 2>&1|awk '/Sun C/' || true)), )
- CFLAGS+=-erroff=E_EMPTY_DECLARATION
+ CFLAGS+= -erroff=E_EMPTY_DECLARATION
FDEBUG=
endif
@@ -52,11 +52,12 @@ endif
endif
PREFIX?= /usr/local
-INSTALLDIR= install -d
-INSTALLBIN= install -g bin -o root -m 555
-INSTALLMAN= install -g bin -o root -m 444
+INSTALL?= install
+INSTALLDIR= $(INSTALL) -d
+INSTALLBIN= $(INSTALL) -m 555
+INSTALLMAN= $(INSTALL) -m 444
-SRCS= $(shell echo *.c|sed 's|osdep-[a-z0-9]*.c||g')
+SRCS= $(shell echo *.c|LC_ALL=C sed 's|osdep-[a-z0-9]*.c||g')
include config.mk
OBJS= $(patsubst %.c,%.o,$(SRCS))
View
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.155 2010/03/10 15:15:33 tcunha Exp $
+# $Id: Makefile,v 1.160 2010/07/18 13:36:52 tcunha Exp $
#
# Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
#
@@ -18,7 +18,7 @@
.SUFFIXES: .c .o
.PHONY: clean
-VERSION= 1.2
+VERSION= 1.3
#FDEBUG= 1
@@ -48,11 +48,12 @@ CFLAGS+= -Wno-pointer-sign
.endif
PREFIX?= /usr/local
-INSTALLDIR= install -d
-INSTALLBIN= install -g bin -o root -m 555
-INSTALLMAN= install -g bin -o root -m 444
+INSTALL?= install
+INSTALLDIR= ${INSTALL} -d
+INSTALLBIN= ${INSTALL} -m 555
+INSTALLMAN= ${INSTALL} -m 444
-SRCS!= echo *.c|sed 's|osdep-[a-z0-9]*.c||g'
+SRCS!= echo *.c|LC_ALL=C sed 's|osdep-[a-z0-9]*.c||g'
.include "config.mk"
OBJS= ${SRCS:S/.c/.o/}
View
@@ -15,7 +15,6 @@
session not being watched?
- next prev word etc in command prompt
- many more info() displays for various things
-- input.c is too complicated. simplify?
- use a better termcap internally instead of screen, perhaps xterm
- fix rxvt cursor fg issue (text under cursor can have non-white fg)
- should be able to move to a hidden pane and it would be moved into view. pane
@@ -90,8 +89,6 @@
message display
copy and paste cursor and wide characters
...?
-- option so that when session is destroyed, attach client to another session
- rather than exiting
- session history for client and last-session command
- option to change status line colour when current window is in a mode?
- option to move copy mode indicator into status line
@@ -100,12 +97,10 @@
- live update: server started with -U connects to server, requests sessions and
windows, receives fds
- convert status line history to be server global (anything else?)
-- something for -t "last window in session" so a session can be used as a stack
- command to show a tree of sessions-windows-panes (active marked with *)
- sort out inheriting config from shell on new sessions/windows:
should pick up default-path/termios/etc from client if possible,
else leave empty/default
-- define custom layouts
- link panes into multiple windows
- -h option to capture-pane to capture the history as well
- bells should be passed between sessions with visual-bell etc
@@ -118,18 +113,40 @@
- multiline status line
- flag for absolute pane size to resize-pane
- sanity check input to socket
-- stdin fd should be passed up to parent so load-buffer and others could use it
- for nonattaching clients
-- environment should be set up for jobs
- select-buffer command
-- fix jobs so they block in config file rather than executing at an arbitrary
- future point -- need state stored in client so other clients can proceed
-- rectangle copy:
- when selecting leftward, cursor should be inside block per emacs
- key to rotate corner at which cursor is
-- double C-a should walk back over wrapped lines like C-e
- support title stack, both internally and externally
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=1149299+0+archive/2010/freebsd-questions/20100207.freebsd-questions
- copy buffers should be global, limit can be server option, nuke copy-buffer
command
- command to show status line information briefly when it is off
+- some way to pad # stuff with spaces, #!2T maybe
+- FreeBSD console problems
+- a binding to "scroll down and exit at bottom" copy mode
+- some way to pass keystrokes in copy mode through to underlying window
+- last window update time and # replacement for it for display-message
+- find-window across sessions - other ways to make session handling easier?
+- ' and " should be parsed the same (eg "\e" vs '\e') in config and command
+ prompt?
+- command to toggle selection not to move it in copy-mode
+
+For 1.3 (not in order):
+
+3 why are alerts per-winlink? try per window?
+4 audit of escape sequence support vs xterm
+6 rectangle copy: when selecting leftward, cursor should be inside block per
+ emacs key to rotate corner at which cursor is
+9 something for -t "last window in session" so a session can be used as a stack
+10 synchronous commands - client sends cmd and blocks, neww/splitw saves client
+ ptr then when program inside died, sends MSG_SOMETHING with wait status to
+ client
+11 documentation improvements - rlpowell's tutorial
+ - build instructions
+12 better configure? with-libevent
+14 bind commands to key sequences?
+16 monitor, bell etc should monitor /all/ panes in the window not just one
+17 wd should be updated on attach etc. maybe lose default-path and use PWD
+18 a history of commands that can be reversed (reverse member of each command, and a buffer)
+19 info() when changing to same window
+20 don't pass UTF-8 through vis for titles
+...
+
View
@@ -1,4 +1,4 @@
-/* $Id: array.h,v 1.10 2010/02/08 18:29:32 tcunha Exp $ */
+/* $Id: array.h,v 1.11 2010/06/06 00:27:08 tcunha Exp $ */
/*
* Copyright (c) 2006 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -47,7 +47,7 @@
} \
} while (0)
-#define ARRAY_EMPTY(a) ((a) == NULL || (a)->num == 0)
+#define ARRAY_EMPTY(a) (((void *) (a)) == NULL || (a)->num == 0)
#define ARRAY_LENGTH(a) ((a)->num)
#define ARRAY_DATA(a) ((a)->list)
View
@@ -1,4 +1,4 @@
-/* $Id: attributes.c,v 1.3 2009/11/28 14:46:23 tcunha Exp $ */
+/* $Id: attributes.c,v 1.4 2010/06/05 23:54:51 tcunha Exp $ */
/*
* Copyright (c) 2009 Joshua Elsasser <josh@elsasser.org>
@@ -28,7 +28,7 @@ attributes_tostring(u_char attr)
static char buf[128];
if (attr == 0)
- return ("default");
+ return ("none");
buf[0] = '\0';
if (attr & GRID_ATTR_BRIGHT)
@@ -63,7 +63,7 @@ attributes_fromstring(const char *str)
if (strchr(delimiters, str[strlen(str) - 1]) != NULL)
return (-1);
- if (strcasecmp(str, "default") == 0)
+ if (strcasecmp(str, "default") == 0 || strcasecmp(str, "none") == 0)
return (0);
attr = 0;
View
@@ -1,4 +1,4 @@
-/* $Id: cfg.c,v 1.26 2010/02/08 18:29:32 tcunha Exp $ */
+/* $Id: cfg.c,v 1.27 2010/06/06 00:04:18 tcunha Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -69,7 +69,7 @@ cfg_add_cause(struct causelist *causes, const char *fmt, ...)
/*
* Load configuration file. Returns -1 for an error with a list of messages in
- * causes. Note that causes and ncauses must be initialised by the caller!
+ * causes. Note that causes must be initialised by the caller!
*/
int
load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes)
View
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.90 2009/12/04 22:14:47 tcunha Exp $ */
+/* $Id: client.c,v 1.95 2010/07/02 02:52:13 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -17,7 +17,6 @@
*/
#include <sys/types.h>
-#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>
@@ -101,8 +100,7 @@ client_init(char *path, int cmdflags, int flags)
if (cmdflags & CMD_SENDENVIRON)
client_send_environ();
- if (isatty(STDIN_FILENO))
- client_send_identify(flags);
+ client_send_identify(flags);
return (&client_ibuf);
@@ -119,12 +117,9 @@ void
client_send_identify(int flags)
{
struct msg_identify_data data;
- struct winsize ws;
char *term;
int fd;
- if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) == -1)
- fatal("ioctl(TIOCGWINSZ)");
data.flags = flags;
if (getcwd(data.cwd, sizeof data.cwd) == NULL)
@@ -139,6 +134,14 @@ client_send_identify(int flags)
fatal("dup failed");
imsg_compose(&client_ibuf,
MSG_IDENTIFY, PROTOCOL_VERSION, -1, fd, &data, sizeof data);
+
+ if ((fd = dup(STDOUT_FILENO)) == -1)
+ fatal("dup failed");
+ imsg_compose(&client_ibuf, MSG_STDOUT, PROTOCOL_VERSION, -1, fd, NULL, 0);
+
+ if ((fd = dup(STDERR_FILENO)) == -1)
+ fatal("dup failed");
+ imsg_compose(&client_ibuf, MSG_STDERR, PROTOCOL_VERSION, -1, fd, NULL, 0);
}
void
@@ -176,35 +179,19 @@ client_update_event(void)
__dead void
client_main(void)
{
- struct event ev_sigcont, ev_sigterm, ev_sigwinch;
- struct sigaction sigact;
-
logfile("client");
/* Note: event_init() has already been called. */
/* Set up signals. */
- memset(&sigact, 0, sizeof sigact);
- sigemptyset(&sigact.sa_mask);
- sigact.sa_flags = SA_RESTART;
- sigact.sa_handler = SIG_IGN;
- if (sigaction(SIGINT, &sigact, NULL) != 0)
- fatal("sigaction failed");
- if (sigaction(SIGPIPE, &sigact, NULL) != 0)
- fatal("sigaction failed");
- if (sigaction(SIGUSR1, &sigact, NULL) != 0)
- fatal("sigaction failed");
- if (sigaction(SIGUSR2, &sigact, NULL) != 0)
- fatal("sigaction failed");
- if (sigaction(SIGTSTP, &sigact, NULL) != 0)
- fatal("sigaction failed");
-
- signal_set(&ev_sigcont, SIGCONT, client_signal, NULL);
- signal_add(&ev_sigcont, NULL);
- signal_set(&ev_sigterm, SIGTERM, client_signal, NULL);
- signal_add(&ev_sigterm, NULL);
- signal_set(&ev_sigwinch, SIGWINCH, client_signal, NULL);
- signal_add(&ev_sigwinch, NULL);
+ set_signals(client_signal);
+
+ /*
+ * Send a resize message immediately in case the terminal size has
+ * changed between the identify message to the server and the MSG_READY
+ * telling us to move into the client code.
+ */
+ client_write_server(MSG_RESIZE, NULL, 0);
/*
* imsg_read in the first client poll loop (before the terminal has
@@ -233,6 +220,11 @@ client_signal(int sig, unused short events, unused void *data)
struct sigaction sigact;
switch (sig) {
+ case SIGHUP:
+ client_exitmsg = "lost tty";
+ client_exitval = 1;
+ client_write_server(MSG_EXITING, NULL, 0);
+ break;
case SIGTERM:
client_exitmsg = "terminated";
client_exitval = 1;
Oops, something went wrong.

0 comments on commit fb53a63

Please sign in to comment.