Skip to content

Commit

Permalink
Import upstream version 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rfrancoise committed Dec 28, 2010
1 parent 785299d commit 77c63de
Show file tree
Hide file tree
Showing 67 changed files with 2,296 additions and 1,194 deletions.
43 changes: 42 additions & 1 deletion CHANGES
@@ -1,3 +1,44 @@
CHANGES FROM 1.3 TO 1.4, 27 December 2010

* Window bell reporting fixed.
* Show which pane is active in the list-panes output.
* Backoff reworked.
* Prevent the server from dying when switching into copy mode when already
in a different mode.
* Reset running jobs when the status line is enabled or disabled.
* Simplify xterm modifier detection.
* Avoid crashing in copy mode if the screen size is too small for the
indicator.
* Flags -n and -p added to switch-client.
* Use UTF-8 line drawing characters on UTF-8 terminals, thus fixing some
terminals (eg putty) which disable the vt100 ACS mode switching sequences
in UTF-8 mode. On terminals without ACS, use ASCII equivalents.
* New server option exit-unattached added.
* New session option destroy-unattached added.
* Fall back on normal session choice method if $TMUX exists but is invalid
rather than rejecting.
* Mark repeating keys with "(repeat)" in the key list.
* When removing a pane, don't change the active pane unless the active pane
is actually the one being removed.
* New command last-pane added.
* AIX fixes.
* Flag -a added to unbind-key.
* Add XAUTHORITY to update-environment.
* More info regarding window and pane flags is now shown in list-*.
* If VISUAL or EDITOR contains "vi" configure mode-keys and status-key to vi.
* New window option monitor-silence and session option visual-silence added.
* In the built-in layouts distribute the panes more evenly.
* Set the default value of main-pane-width to 80 instead of 81.
* Command-line flag -V added.
* Instead of keeping a per-client prompt history make it global.
* Fix rectangle copy to behave like emacs (the cursor is not part of the
selection on the right edge but on the left it is).
* Flag -l added to switch-client.
* Retrieve environment variables from the global environment rather than
getenv(3), thus allowing them to be updated during the configuration file.
* New window options other-pane-{height,width} added.
* More minor bugs fixed and manpage improvements.

CHANGES FROM 1.2 TO 1.3, 18 July 2010

* New input parser.
Expand Down Expand Up @@ -1513,7 +1554,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.303 2010/07/18 13:40:59 tcunha Exp $
$Id: CHANGES,v 1.304 2010/12/27 21:37:42 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
Expand Down
181 changes: 157 additions & 24 deletions FAQ
Expand Up @@ -12,29 +12,99 @@ tmux frequently asked questions
* and derivatives. *
******************************************************************************

* 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.
* How is tmux different from GNU screen?

tmux and GNU screen have many similarities. Some of the main differences I am
aware of are (bearing in mind I haven't used screen for a few years now):

- tmux uses a client-server model. Each server has single Unix domain socket in
/tmp and within one server there are multiple sessions which may be attached
to multiple clients (terminals).

This has advantages, notably: windows may be linked simultaneously to
multiple sessions; windows may be moved freely between sessions; and a client
may be switched between sessions easily (C-b D). There is one major
disadvantage: if the server crashes, game over, all sessions die. In
practice, however, tmux is quite stable and gets more so as people report any
bugs they hit :-).

This model is different from screen, where typically each new screen instance
is independent. tmux supports the same behaviour by using multiple servers
with the -L option but it is not typically recommended.

- Different command interfaces. One of the goals of tmux is that the shell
should be easily usable as a scripting language - almost all tmux commands
can be used from the shell and behave identically whether used from the
shell, from a key binding or from the command prompt. Personally I also find
tmux's command interface much more consistent and clearer, but this is
subjective.

- tmux calls window names (what you see in the status line) "names", screen
calls them "titles".

- tmux has a multiple paste buffers. Not a major one but comes in handy quite a
lot.

- tmux supports automatically renaming windows to the running application
without gross hacks using escape sequences. Its even on by default.

- tmux has a choice of vi or emacs key layouts. Again, not major, but I use
emacs so if tmux did support only one key set it would be emacs and then all
the vi users would get humpy. Key bindings may be completely reconfigured in
any case.

- tmux has an option to limit the window size.

- tmux has search in windows (C-b f).

- The window split (pane) model is different. tmux has two objects, windows and
panes; screen has just windows. This difference has several implications:

* In screen you can have a window appear in several layouts, in tmux a pane
can only be in one window (fixing this is a big todo item but quite
invasive).

* tmux layouts are immutable and do not get changed unless you modify them.

* In tmux, all panes are closed when you kill a window.

* tmux panes do not have individual names, titles and so on.

I think tmux's model is much easier to manage and navigate within a window,
but breaking panes off from and joining them to windows is more clumsy.

tmux also has support for preset pane layouts.

- tmux's status line syntax is more readable and easier to use. I think it'd be
hard for anyone to argue with this. tmux doesn't support running a command
constantly and always using the last line of its output, commands must be run
again each time.

- tmux has modern, easily extended code. Again hard to argue screen is better
if you have looked at the code.

- tmux depends on libevent. I don't see this as a disadvantage: libevent is
small and portable, and on modern systems with current package management
systems dependencies are not an issue. libevent brings advantages in code
simplicity and performance.

- screen allows the window to be bigger than the terminal and can pan around
it. tmux limits the size to the largest attached client. This is a big todo
item for tmux but it is not trivial.

- screen has builtin serial and telnet support; this is bloat and is unlikely
to be added to tmux.

- screen has support for updating utmp. Nobody has really come up with a clean,
portable way to do this without making tmux setuid or setgid yet.

- Environment handling is different.

- tmux tends to be more demanding on the terminal so tends to show up terminal
and application bugs which screen does not.

- screen has wider platform support, for example IRIX and HP-UX, and for odd
terminals.

* I found a bug! What do I do?

Expand Down Expand Up @@ -167,6 +237,8 @@ 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.

vim users may also want to set the "ttyfast" option inside tmux.

* 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
Expand Down Expand Up @@ -239,4 +311,65 @@ set -g terminal-overrides "xterm*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx

Note that this will only work in tmux 1.2 and above.

$Id: FAQ,v 1.36 2010/02/04 21:01:59 nicm Exp $
* How can I blank the tmux window?

GNU screen has a feature whereby it will blank the screen after a period of
inactivity. To do the same thing in tmux, use the lock-command setting, for
example (with GNU bash):

set -g lock-command 'tput civis && read -s -n1'

This will remove the cursor and tell the shell to quit once a key has been
pressed. For zsh, use "read -s -k1".

In addition, it's possible to have both blanking and locking (for instance via
lock(1) or vlock(1)) by using the following:

bind x set lock-command '/usr/bin/vlock' \; lock-client \; set lock-command 'tput civis && read -s -n1'

* How can I open a new window in the same directory as the current window?

One option is to just run "TMUX= tmux" in the window. However, this only works if no
command is running, so that you can input the command.

A workaround is to let tmux know about the current path through an environment
variable. To do so, use the following command:

[ -n "$TMUX" ] && tmux setenv TMUXPWD_$(tmux display -p "#I") $PWD

Which sets TMUXPWD_i (where i is the number of the current window) to the path
of the current directory. This command can be added to PS1, for example:

PS1='$([ -n "$TMUX" ] && tmux setenv TMUXPWD_$(tmux display -p "#I") $PWD)\h$ '

When a new window is created, the shell should be asked to change
directory. You can define a new binding (for example, if using GNU bash):

bind-key C-c run-shell 'tmux neww "cd $(tmux display -p "\$TMUXPWD_#I"); exec bash"'

This solution will work even if a command is currently running in the terminal,
but it will not work from a window that has just been swapped with another
because TMUXPWD_i will not be updated after a swap. However, once a new prompt
is displayed, TMUXPWD_i is updated properly.

* tmux doesn't start with "daemon failed"

tmux shows something similar to this when started:

fatal: server_start: daemon failed: No such file or directory
fatal: main_dispatch: imsg_read failed

A possible reason is that /dev/null is not a character device or is otherwise
inaccessible.

Check with:

file /dev/null
ls -l /dev/null

If it is not a character device or has incorrect permissions, it can typically
be recreated with:

cd /dev && rm null && ./MAKEDEV null

$Id: FAQ,v 1.41 2010/12/15 23:31:30 nicm Exp $
4 changes: 2 additions & 2 deletions GNUmakefile
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.128 2010/07/18 13:36:52 tcunha Exp $
# $Id: GNUmakefile,v 1.130 2010/12/27 21:32:16 tcunha Exp $
#
# Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
#
Expand All @@ -17,7 +17,7 @@

.PHONY: clean

VERSION= 1.3
VERSION= 1.4

#FDEBUG= 1

Expand Down
4 changes: 2 additions & 2 deletions Makefile
@@ -1,4 +1,4 @@
# $Id: Makefile,v 1.160 2010/07/18 13:36:52 tcunha Exp $
# $Id: Makefile,v 1.162 2010/12/27 21:32:16 tcunha Exp $
#
# Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
#
Expand All @@ -18,7 +18,7 @@
.SUFFIXES: .c .o
.PHONY: clean

VERSION= 1.3
VERSION= 1.4

#FDEBUG= 1

Expand Down
25 changes: 1 addition & 24 deletions NOTES
Expand Up @@ -25,34 +25,11 @@ windows into several simultaneously displayed panes; and to bind and unbind
command keys (invoked preceded by a prefix key, by default ctrl-b). Please see
the tmux(1) man page for further information.

The following is a summary of major features implemented in this version:

- Basic multiplexing, window switching, attaching and detaching.
- Window listing and renaming.
- Key binding.
- Handling of client terminal resize.
- Terminal emulation sufficient to handle most curses applications.
- A optional status line (enabled by default).
- Window history and copy and paste.
- Support for VT100 line drawing characters.
- A large command set.
- Vertical window splitting and layout.
- Automatic server locking on inactivity by running an external command.
- A configuration file.
- UTF-8 support.

A more extensive, but rough, todo list is included in the TODO file.

tmux also depends on several features of the client terminal (TERM), if these
are missing it may refuse to run, or not behave correctly.

tmux supports UTF-8. To use it, the utf8 option must be set on each window;
this may be turned on for all windows by setting it as a global option, see
tmux(1) and the FAQ file. As of 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.

A Vim syntax file is available in the examples directory. To install it:

- Drop the file in the syntax directory in your runtimepath (such as
Expand Down Expand Up @@ -86,4 +63,4 @@ start. Please contact me with any queries.

-- Nicholas Marriott <nicm@users.sf.net>

$Id: NOTES,v 1.53 2010/03/10 15:18:11 tcunha Exp $
$Id: NOTES,v 1.54 2010/12/27 21:36:37 tcunha Exp $

0 comments on commit 77c63de

Please sign in to comment.