Permalink
Browse files

Imported Upstream version 1.1

  • Loading branch information...
Karl Ferdinand Ebert
Karl Ferdinand Ebert committed Nov 22, 2009
0 parents commit 8fade26b3798d6ea6d06cd4a1ebfeb271e8c8893
Showing with 40,328 additions and 0 deletions.
  1. +1,418 −0 CHANGES
  2. +204 −0 FAQ
  3. +86 −0 GNUmakefile
  4. +83 −0 Makefile
  5. +91 −0 NOTES
  6. +97 −0 TODO
  7. +119 −0 array.h
  8. +93 −0 attributes.c
  9. +55 −0 buffer-poll.c
  10. +139 −0 buffer.c
  11. +127 −0 cfg.c
  12. +325 −0 client.c
  13. +159 −0 clock.c
  14. +106 −0 cmd-attach-session.c
  15. +201 −0 cmd-bind-key.c
  16. +84 −0 cmd-break-pane.c
  17. +152 −0 cmd-choose-client.c
  18. +162 −0 cmd-choose-session.c
  19. +179 −0 cmd-choose-window.c
  20. +55 −0 cmd-clear-history.c
  21. +52 −0 cmd-clock-mode.c
  22. +266 −0 cmd-command-prompt.c
  23. +147 −0 cmd-confirm-before.c
  24. +204 −0 cmd-copy-buffer.c
  25. +70 −0 cmd-copy-mode.c
  26. +59 −0 cmd-delete-buffer.c
  27. +52 −0 cmd-detach-client.c
  28. +63 −0 cmd-display-message.c
  29. +52 −0 cmd-display-panes.c
  30. +59 −0 cmd-down-pane.c
  31. +162 −0 cmd-find-window.c
  32. +418 −0 cmd-generic.c
  33. +49 −0 cmd-has-session.c
  34. +117 −0 cmd-if-shell.c
  35. +76 −0 cmd-kill-pane.c
  36. +49 −0 cmd-kill-server.c
  37. +66 −0 cmd-kill-session.c
  38. +53 −0 cmd-kill-window.c
  39. +58 −0 cmd-last-window.c
  40. +66 −0 cmd-link-window.c
  41. +78 −0 cmd-list-buffers.c
  42. +65 −0 cmd-list-clients.c
  43. +49 −0 cmd-list-commands.c
  44. +125 −0 cmd-list-keys.c
  45. +74 −0 cmd-list-panes.c
  46. +74 −0 cmd-list-sessions.c
  47. +58 −0 cmd-list-windows.c
  48. +119 −0 cmd-list.c
  49. +101 −0 cmd-load-buffer.c
  50. +53 −0 cmd-lock-client.c
  51. +51 −0 cmd-lock-server.c
  52. +53 −0 cmd-lock-session.c
  53. +67 −0 cmd-move-window.c
  54. +316 −0 cmd-new-session.c
  55. +206 −0 cmd-new-window.c
  56. +54 −0 cmd-next-layout.c
  57. +76 −0 cmd-next-window.c
  58. +100 −0 cmd-paste-buffer.c
  59. +125 −0 cmd-pipe-pane.c
  60. +54 −0 cmd-previous-layout.c
  61. +76 −0 cmd-previous-window.c
  62. +52 −0 cmd-refresh-client.c
  63. +57 −0 cmd-rename-session.c
  64. +59 −0 cmd-rename-window.c
  65. +113 −0 cmd-resize-pane.c
  66. +94 −0 cmd-respawn-window.c
  67. +124 −0 cmd-rotate-window.c
  68. +137 −0 cmd-run-shell.c
  69. +88 −0 cmd-save-buffer.c
  70. +88 −0 cmd-select-layout.c
  71. +58 −0 cmd-select-pane.c
  72. +91 −0 cmd-select-prompt.c
  73. +69 −0 cmd-select-window.c
  74. +152 −0 cmd-send-keys.c
  75. +55 −0 cmd-send-prefix.c
  76. +189 −0 cmd-server-info.c
  77. +68 −0 cmd-set-buffer.c
  78. +88 −0 cmd-set-environment.c
  79. +223 −0 cmd-set-option.c
  80. +170 −0 cmd-set-window-option.c
  81. +101 −0 cmd-show-buffer.c
  82. +67 −0 cmd-show-environment.c
  83. +69 −0 cmd-show-options.c
  84. +69 −0 cmd-show-window-options.c
  85. +124 −0 cmd-source-file.c
  86. +256 −0 cmd-split-window.c
  87. +44 −0 cmd-start-server.c
  88. +358 −0 cmd-string.c
  89. +62 −0 cmd-suspend-client.c
  90. +143 −0 cmd-swap-pane.c
  91. +85 −0 cmd-swap-window.c
  92. +136 −0 cmd-switch-client.c
  93. +142 −0 cmd-unbind-key.c
  94. +71 −0 cmd-unlink-window.c
  95. +59 −0 cmd-up-pane.c
  96. +972 −0 cmd.c
  97. +162 −0 colour.c
  98. +209 −0 compat.h
  99. +89 −0 compat/asprintf.c
  100. +129 −0 compat/bitstring.h
  101. +124 −0 compat/bsd-poll.c
  102. +59 −0 compat/bsd-poll.h
  103. +69 −0 compat/daemon.c
  104. +88 −0 compat/fgetln.c
  105. +95 −0 compat/forkpty-aix.c
  106. +89 −0 compat/forkpty-sunos.c
  107. +117 −0 compat/getopt.c
  108. +303 −0 compat/imsg-buffer.c
  109. +271 −0 compat/imsg.c
  110. +110 −0 compat/imsg.h
  111. +528 −0 compat/queue.h
  112. +61 −0 compat/strcasestr.c
  113. +58 −0 compat/strlcat.c
  114. +54 −0 compat/strlcpy.c
  115. +72 −0 compat/strsep.c
  116. +68 −0 compat/strtonum.c
  117. +739 −0 compat/tree.h
  118. +281 −0 compat/unvis.c
  119. +220 −0 compat/vis.c
  120. +83 −0 compat/vis.h
  121. +271 −0 configure
  122. +145 −0 environ.c
  123. +42 −0 examples/h-boetes.conf
  124. +101 −0 examples/n-marriott.conf
  125. +104 −0 examples/screen-keys.conf
  126. +104 −0 examples/t-williams.conf
  127. +96 −0 examples/tmux.vim
  128. +234 −0 grid-view.c
  129. +588 −0 grid.c
  130. +231 −0 input-keys.c
  131. +1,497 −0 input.c
  132. +196 −0 job.c
  133. +267 −0 key-bindings.c
  134. +205 −0 key-string.c
  135. +445 −0 layout-set.c
  136. +649 −0 layout.c
  137. +213 −0 log.c
  138. +416 −0 mode-key.c
  139. +127 −0 names.c
  140. +263 −0 options-cmd.c
  141. +201 −0 options.c
  142. +47 −0 osdep-darwin.c
  143. +129 −0 osdep-freebsd.c
  144. +59 −0 osdep-linux.c
  145. +122 −0 osdep-netbsd.c
  146. +140 −0 osdep-openbsd.c
  147. +65 −0 osdep-sunos.c
  148. +27 −0 osdep-unknown.c
  149. +136 −0 paste.c
  150. +153 −0 resize.c
  151. +288 −0 screen-redraw.c
  152. +1,180 −0 screen-write.c
  153. +274 −0 screen.c
  154. +768 −0 server-client.c
  155. +373 −0 server-fn.c
  156. +73 −0 server-job.c
  157. +341 −0 server-window.c
  158. +640 −0 server.c
  159. +594 −0 session.c
  160. +1,068 −0 status.c
  161. +2,219 −0 tmux.1
  162. +681 −0 tmux.c
  163. +1,961 −0 tmux.h
  164. +418 −0 tty-keys.c
  165. +501 −0 tty-term.c
  166. +1,359 −0 tty.c
  167. +340 −0 utf8.c
  168. +375 −0 window-choose.c
  169. +124 −0 window-clock.c
  170. +1,290 −0 window-copy.c
  171. +247 −0 window-more.c
  172. +737 −0 window.c
  173. +145 −0 xmalloc.c
  174. +201 −0 xterm-keys.c
1,418 CHANGES

Large diffs are not rendered by default.

Oops, something went wrong.
204 FAQ
@@ -0,0 +1,204 @@
+tmux frequently asked questions
+
+* How is tmux different from GNU screen? What else does it offer?
+
+tmux offers several advantages over screen:
+
+- a clearly-defined client-server model: windows are independent entities which
+ may be attached simultaneously to multiple sessions and viewed from multiple
+ clients (terminals), as well as moved freely between sessions within the same
+ tmux server;
+- a consistent, well-documented command interface, with the same syntax
+ whether used interactively, as a key binding, or from the shell;
+- easily scriptable from the shell;
+- multiple paste buffers;
+- choice of vi or emacs key layouts;
+- an option to limit the window size;
+- a more usable status line syntax, with the ability to display the first line
+ of output of a specific command;
+- a cleaner, modern, easily extended, BSD-licensed codebase.
+
+There are still a few features screen includes that tmux omits:
+
+- builtin serial and telnet support; this is bloat and is unlikely to be added
+ to tmux;
+- wider platform support, for example IRIX and HP-UX, and for odd terminals.
+
+* I found a bug! What do I do?
+
+Please send bug reports by email to nicm@users.sourceforge.net. Please
+include as much of the following information as possible:
+
+- the version of tmux you are running;
+- the operating system you are using and its version;
+- the terminal emulator you are using and the TERM setting when tmux was
+ started;
+- a description of the problem;
+- if the problem is repeatable, the steps to repeat the problem;
+- for screen corruption issues, a screenshot and the output of "infocmp $TERM"
+ from outside tmux are often very useful.
+
+* Why doesn't tmux do $x?
+
+Please send feature requests by email to nicm@users.sourceforge.net.
+
+* Why do you use the screen terminal description inside tmux? It sucks.
+
+It is already widely available. It is planned to change to something else such
+as xterm-xfree86 at some point, if possible.
+
+* I don't see any colour in my terminal! Help!
+
+On some platforms, common terminal descriptions such as xterm do not include
+colour. screen ignores this, tmux does not. If the terminal emulator in use
+supports colour, use a value for TERM which correctly lists this, such as
+xterm-color.
+
+* tmux freezes my terminal when I attach to a session. I even have to kill -9
+ the shell it was started from to recover!
+
+Some consoles really really don't like attempts to set the window title. Tell
+tmux not to do this by turning off the "set-titles" option (you can do this
+in .tmux.conf):
+
+ set -g set-titles off
+
+If this doesn't fix it, send a bug report.
+
+* Why is C-b the prefix key? How do I change it?
+
+The default key is C-b because the prototype of tmux was originally developed
+inside screen and C-b was chosen not to clash with the screen meta key. It
+also has the advantage of not interfering with the use of C-a for start-of-line
+in emacs and the shell (although it does interfere with previous-character).
+
+Changing is simple: change the "prefix-key" option, and - if required - move
+the binding of the "send-prefix" command from C-b (C-b C-b sends C-b by
+default) to the new key. For example:
+
+ set -g prefix C-a
+ unbind C-b
+ bind C-a send-prefix
+
+* How do I use UTF-8?
+
+When running tmux in a UTF-8 capable terminal, two things must be done to
+enable support. UTF-8 must be turned on in tmux; this may be done separately
+for each tmux window or globally by setting the "utf8" flag:
+
+ setw -g utf8 on
+
+As of release 0.9, tmux attempts to autodetect a UTF-8-capable terminal by
+checking the LC_ALL, LC_CTYPE and LANG environment variables. list-clients may
+be used to check if this is detected correctly; if not, the -u command-line
+flag may be specified when creating or attaching a client to a tmux session:
+
+ $ tmux -u new
+
+* How do I use a 256 colour terminal?
+
+Provided the underlying terminal supports 256 colours, it is usually sufficient
+to add the following to ~/.tmux.conf:
+
+ set -g default-terminal "screen-256color"
+
+Note that some platforms do not support "screen-256color" ("infocmp
+screen-256color" will return an error) - in this case see the next entry in
+this FAQ.
+
+tmux attempts to detect a 256 colour terminal both by looking at the colors
+terminfo entry and by looking for the string "256col" in the TERM environment
+variable.
+
+If both these methods fail, the -2 flag may be passed to tmux when attaching
+to a session to indicate the terminal supports 256 colours.
+
+* vim or $otherprogram doesn't display 256 colours. What's up?
+
+Some programs attempt to detect the number of colours a terminal is capable of
+by checking the colors terminfo or Co termcap entry. However, this is not
+reliable, and in any case is missing from the "screen" terminal description
+used inside tmux.
+
+There are two options (aside from using "screen-256color") to allow programs to
+recognise they are running on a 256-colour terminal inside tmux:
+
+- Manually force the application to use 256 colours always or if TERM is set to
+ screen. For vim, you can do this by overriding the t_Co option, see
+ http://vim.wikia.com/wiki/256_colors_in_vim.
+- Creating a custom terminfo file that includes colors#256 in ~/.terminfo and
+ using it instead. These may be compiled with tic(1).
+
+* How do I make Ctrl-PgUp and Ctrl-PgDn work in vim?
+
+tmux supports passing through ctrl (and where supported by the client terminal,
+alt and shift) modifiers to function keys using xterm(1)-style key sequences.
+This may be enabled per window, or globally with the tmux command:
+
+ setw -g xterm-keys on
+
+Because the TERM variable inside tmux must be set to "screen", vim will not
+automatically detect these keys are available; however, the appropriate key
+sequences can be overridden in .vimrc using the following:
+
+ if &term == "screen"
+ set t_kN=^[[6;*~
+ set t_kP=^[[5;*~
+ endif
+
+And similarly for any other keys for which modifiers are desired.
+
+Please note that the "xterm-keys" setting may affect other programs, in the
+same way as running them in a standard xterm; for example most shells do not
+expect to receive xterm(1)-style key sequences so this setting may prevent keys
+such as ctrl-left and ctrl-right working correctly. tmux also passes through
+the ctrl (bit 5 set, for example ^[[5~ to ^[[5^) modifier in non-xterm(1) mode;
+it may be possible to configure vim to accept these, an example of how to do so
+would be welcome.
+
+* Why doesn't elinks set the window title inside tmux?
+
+There isn't a way to detect if a terminal supports setting the window title, so
+elinks attempts to guess by looking at the environment. Rather than looking for
+TERM=screen, it uses the STY variable to detect if it is running in screen;
+tmux does not use this so the check fails. A workaround is to set STY before
+running elinks.
+
+The following shell function does this, and also clears the window title on
+exit (elinks, for some strange reason, sets it to the value of TERM):
+
+ elinks() {
+ STY= `which elinks` $*
+ echo -ne \\033]0\;\\007;
+ }
+
+* What is the proper way to escape characters with #(command)?
+
+When using the #(command) construction to include the output from a command in
+the status line, the command will be parsed twice. First, when it's read by the
+configuration file or the command-prompt parser, and second when the status
+line is being drawn and the command is passed to the shell. For example, to
+echo the string "(test)" to the status line, either single or double quotes
+could be used:
+
+ set -g status-right "#(echo \\\\(test\\\\))"
+ set -g status-right '#(echo \\\(test\\\))'
+
+In both cases, the status-right option will be set to the string "#(echo
+\\(test\\))" and the command executed will be "echo \(test\)".
+
+* tmux uses too much CPU. What do I do?
+
+Automatic window renaming may use a lot of CPU, particularly on slow computers:
+if this is a problem, turn it off with "setw -g automatic-rename off". If this
+doesn't fix it, please report the problem.
+
+* I use PuTTY and my tmux window pane separators are all qqqqqqqqq's!
+
+PuTTY is using a character set translation that doesn't support ACS line
+drawing. With a Unicode font, try setting PuTTY to use a different translation
+on the Window -> Translation configuration page. For example, change UTF-8 to
+ISO-8859-1 or CP437. It may also be necessary to adjust the way PuTTY treats
+line drawing characters in the lower part of the same configuration page.
+
+$Id: FAQ,v 1.29 2009/08/08 20:46:26 nicm Exp $
@@ -0,0 +1,86 @@
+# $Id: GNUmakefile,v 1.120 2009/11/05 12:30:55 tcunha Exp $
+#
+# Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
+# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+# OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+.PHONY: clean
+
+VERSION= 1.1
+
+#FDEBUG= 1
+
+CC?= cc
+CFLAGS+= -DBUILD="\"$(VERSION)\""
+LDFLAGS+= -L/usr/local/lib
+LIBS+=
+
+# Sun CC
+ifneq ($(shell ($(CC) -V 2>&1|awk '/Sun C/' || true)), )
+ CFLAGS+=-erroff=E_EMPTY_DECLARATION
+ FDEBUG=
+endif
+
+ifdef FDEBUG
+CFLAGS+= -g -ggdb -DDEBUG
+CFLAGS+= -Wno-long-long -Wall -W -Wnested-externs -Wformat=2
+CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
+CFLAGS+= -Wwrite-strings -Wshadow -Wpointer-arith -Wsign-compare
+CFLAGS+= -Wundef -Wbad-function-cast -Winline -Wcast-align
+endif
+
+# This sort of sucks but gets rid of the stupid warning and should work on
+# most platforms...
+ifeq ($(shell (LC_ALL=C $(CC) -v 2>&1|awk '/gcc version 4|clang/') || true), )
+CPPFLAGS:= -I. -I- $(CPPFLAGS)
+else
+CPPFLAGS:= -iquote. $(CPPFLAGS)
+ifdef FDEBUG
+CFLAGS+= -Wno-pointer-sign
+endif
+endif
+
+PREFIX?= /usr/local
+INSTALLDIR= install -d
+INSTALLBIN= install -g bin -o root -m 555
+INSTALLMAN= install -g bin -o root -m 444
+
+SRCS= $(shell echo *.c|sed 's|osdep-[a-z0-9]*.c||g')
+include config.mk
+OBJS= $(patsubst %.c,%.o,$(SRCS))
+
+all: tmux
+
+tmux: $(OBJS)
+ $(CC) $(LDFLAGS) -o tmux $+ $(LIBS)
+
+depend: $(SRCS)
+ $(CC) $(CPPFLAGS) $(CFLAGS) -MM $(SRCS) > .depend
+
+clean:
+ rm -f tmux *.o *~ *.core *.log compat/*.o compat/*~
+
+clean-depend:
+ rm -f .depend
+
+clean-all: clean clean-depend
+ rm -f config.h config.mk
+
+install: all
+ $(INSTALLDIR) $(DESTDIR)$(PREFIX)/bin
+ $(INSTALLBIN) tmux $(DESTDIR)$(PREFIX)/bin/tmux
+ $(INSTALLDIR) $(DESTDIR)$(PREFIX)/man/man1
+ $(INSTALLMAN) tmux.1 $(DESTDIR)$(PREFIX)/man/man1/tmux.1
+
+-include .depend
@@ -0,0 +1,83 @@
+# $Id: Makefile,v 1.153 2009/11/05 12:30:55 tcunha Exp $
+#
+# Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
+# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+# OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+.SUFFIXES: .c .o
+.PHONY: clean
+
+VERSION= 1.1
+
+#FDEBUG= 1
+
+CC?= cc
+CFLAGS+= -DBUILD="\"$(VERSION)\""
+LDFLAGS+= -L/usr/local/lib
+LIBS+=
+
+.ifdef FDEBUG
+CFLAGS+= -g -ggdb -DDEBUG
+CFLAGS+= -Wno-long-long -Wall -W -Wnested-externs -Wformat=2
+CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
+CFLAGS+= -Wwrite-strings -Wshadow -Wpointer-arith -Wsign-compare
+CFLAGS+= -Wundef -Wbad-function-cast -Winline -Wcast-align
+.endif
+
+# This sort of sucks but gets rid of the stupid warning and should work on
+# most platforms...
+CCV!= (LC_ALL=C ${CC} -v 2>&1|awk '/gcc version 4|clang/') || true
+.if empty(CCV)
+CPPFLAGS:= -I. -I- -I/usr/local/include ${CPPFLAGS}
+.else
+CPPFLAGS:= -iquote. -I/usr/local/include ${CPPFLAGS}
+.ifdef FDEBUG
+CFLAGS+= -Wno-pointer-sign
+.endif
+.endif
+
+PREFIX?= /usr/local
+INSTALLDIR= install -d
+INSTALLBIN= install -g bin -o root -m 555
+INSTALLMAN= install -g bin -o root -m 444
+
+SRCS!= echo *.c|sed 's|osdep-[a-z0-9]*.c||g'
+.include "config.mk"
+OBJS= ${SRCS:S/.c/.o/}
+
+.c.o:
+ ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+
+all: tmux
+
+tmux: ${OBJS}
+ ${CC} ${LDFLAGS} -o tmux ${OBJS} ${LIBS}
+
+depend:
+ mkdep ${CPPFLAGS} ${CFLAGS} ${SRCS:M*.c}
+
+clean:
+ rm -f tmux *.o *~ *.core *.log compat/*.o compat/*~
+
+clean-depend:
+ rm -f .depend
+
+clean-all: clean clean-depend
+ rm -f config.h config.mk
+
+install: all
+ ${INSTALLDIR} ${DESTDIR}${PREFIX}/bin
+ ${INSTALLBIN} tmux ${DESTDIR}${PREFIX}/bin/
+ ${INSTALLDIR} ${DESTDIR}${PREFIX}/man/man1
+ ${INSTALLMAN} tmux.1 ${DESTDIR}${PREFIX}/man/man1/
Oops, something went wrong.

0 comments on commit 8fade26

Please sign in to comment.