Commit Graph

309 Commits (677ed3e5f0ed6296e421c974a3e4c90cefe2024c)

Author SHA1 Message Date
Nicholas Marriott 0e59bc75fd Give each window a unique id, like panes but prefixed with @. Based on
work from George Nachman.
2012-01-30 09:39:34 +00:00
Nicholas Marriott 230d0fbc9e Add an option to move the status line to the top of the screen,
requested by many.
2012-01-29 09:37:02 +00:00
Nicholas Marriott 678e67437f Remove unused backoff code that doesn't do any good. 2012-01-21 23:51:34 +00:00
Nicholas Marriott 8ed9124f3f Use RB trees not SPLAY. 2012-01-21 11:12:13 +00:00
Nicholas Marriott 535286c05a Drop the ability to have a list of keys in the prefix in favour of two
separate options, prefix and prefix2. This simplifies the code and gets
rid the data options type which was only used for this one option.

Also add a -2 flag to send-prefix to send the secondary prefix key,
fixing a cause of minor irritation.

People who want three prefix keys are out of luck :-).
2012-01-21 08:40:09 +00:00
Nicholas Marriott 66f04514cf Add a -R flag to send-keys to reset the terminal. Written ages ago and
Suggested by someone, I forget who.
2012-01-21 08:10:21 +00:00
Nicholas Marriott 8332413305 Add some const and fix a warning. 2012-01-20 19:54:07 +00:00
Nicholas Marriott e6519d3e27 Add space movement keys for vi mode in the status line from Ben Boeckel. 2012-01-20 19:10:29 +00:00
Nicholas Marriott f308ba93aa Change the way the working directory for new processes is discovered. If
default-path isn't empty, it is used. Otherwise:

1) If tmux neww is run from the command line, the working directory of the
   client is used.

2) Otherwise sysctl KERN_PROC_CWD is used to retrieve the current
   working directory of the process in the active pane.

3) If that fails, the directory where the session was created is used.

Support code by Romain Francois, OpenBSD specific bits by me.

Note this requires a recent userland and kernel with KERN_PROC_CWD.
2011-12-09 16:28:18 +00:00
Nicholas Marriott e04d13f6a6 Support "jump to" like vi in copy mode using t and T keys. Also add x
and X for delete in edit mode.

From Ben Boeckel, thanks.
2011-12-04 16:18:01 +00:00
Nicholas Marriott fc5f8804ec Add word movement and editing command for command prompt editing, from
Ben Boeckel.
2011-11-15 23:34:12 +00:00
Nicholas Marriott 57df442916 Make window_pane_index work the same as window_index, from Ben Boeckel. 2011-11-15 23:19:51 +00:00
Nicholas Marriott f0aad68aee Support for \e[3J to clear the history. Also send the corresponding
terminfo code (E3) before locking.
2011-10-23 10:16:14 +00:00
Nicholas Marriott 7ff4cf9405 Try to resolve relative paths for loadb and saveb (first using client
working directory if any then default-path or session wd).
2011-10-23 08:34:01 +00:00
Nicholas Marriott 16d75a6bf2 Add client formats, from Ben Boeckel. 2011-10-23 01:12:46 +00:00
Nicholas Marriott 4a5dff3f11 Add initial framework for more powerful formatting of command output and
use it for list-{panes,windows,sessions}. This allows more descriptive
replacements (such as #{session_name}) and conditionals.

Later this will be used for status_replace and list-keys and other
places.
2011-08-26 10:53:16 +00:00
Nicholas Marriott 029c34ce6b Add a tty_bell wrapper function, from Dylan Alex Simon. 2011-08-24 09:58:44 +00:00
Nicholas Marriott ad60a2c952 Allow the initial context on prompts to be set with the new -I option to
command-prompt. From Tiago Cunha.
2011-07-02 21:05:44 +00:00
Nicholas Marriott 1202284f37 PANE_FREEZE doesn't do anything anymore, so remove it. 2011-06-27 00:04:49 +00:00
Nicholas Marriott 65177b82be Add a respawn-pane command, from Marcel Partap. 2011-06-05 11:19:03 +00:00
Nicholas Marriott 2b60c648c4 Get rid of the layout string code which tries to walk through the layout
hierarchy and instead just look at what panes are actually in the window.
2011-06-05 10:53:05 +00:00
Nicholas Marriott 3ea5e06bfb Support DECSCUSR sequence to set the cursor style with two new
terminfo(5) extensions, Cs and Csr. Written by Ailin Nemui.
2011-05-20 19:17:39 +00:00
Nicholas Marriott 944b5e6fa0 Support xterm(1) cursor colour change sequences through terminfo(5) Cc
(set) and Cr (reset) extensions. Originally by Sean Estabrooks, tweaked
by me and Ailin Nemui.
2011-05-20 19:03:58 +00:00
Nicholas Marriott 96e7f33da3 Support setting the xterm clipboard when copying from copy mode using
the xterm escape sequence for the purpose (if xterm is configured to
allow it).

Written by and much discussed Ailin Nemui, guidance on
xterm/termcap/terminfo from Thomas Dickey.
2011-05-18 20:24:29 +00:00
Nicholas Marriott 58908fd8c5 Add three new copy-mode commands - select-line, copy-line,
copy-end-of-line. From Dave Disser and Randy Stauner a while back.
2011-05-18 18:06:36 +00:00
Nicholas Marriott f3741f0653 Add a new option, mouse-resize-pane. When on, panes may be resized by
dragging their borders. From hsim at gmx.li.
2011-05-08 20:34:12 +00:00
Nicholas Marriott 295ace6820 Use the tsl and fsl terminfo(5) capabilities to update terminal title
and automatically fill them in on terminals with the XT capability
(which means their title setting is xterm-compatible). From hsim at
gmx.li.
2011-05-08 19:53:06 +00:00
Nicholas Marriott 8738141913 When mode-mouse is on (it is off by default), automatically enter copy
mode when the mouse is dragged or the mouse wheel is used. Also exit
copy mode when the mouse wheel is scrolled off the bottom. Discussed
with and written by hsim at gmx dot li.
2011-04-19 21:31:33 +00:00
Nicholas Marriott 0bb2119781 Add an option (mouse-select-window) which allows the mouse to be used by
clicking on the status line, written by hsim at gmx dot li.
2011-04-18 19:49:05 +00:00
Nicholas Marriott 0a09d04e1b If the terminal supports sitm for italics, use it instead of standout
(smso). From Tiago Resende.
2011-04-09 07:48:08 +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
Nicholas Marriott 5d519ba526 Add a flag to cmd_find_session so that attach-session can prefer
unattached sessions when choosing the most recently used (if -t is not
given). Suggested by claudio@.
2011-04-05 19:37:01 +00:00
Nicholas Marriott d88c20e718 Change -t on display-message to be target-pane for the #[A-Z]
replacements and add -c as target-client.
2011-03-29 19:30:16 +00:00
Nicholas Marriott fa6abac98d Style: uint -> u_int and a missing else. 2011-03-28 19:44:31 +00:00
Nicholas Marriott 7ce8fee4f3 Don't include meta twice when working out the flags to output for
xterm-style keys - bit 3 is accepted on input but not on output. Also a
style nit in the header.
2011-03-27 20:31:25 +00:00
Nicholas Marriott 808502ac3d Give each pane created in a tmux server a unique id (starting from 0),
put it in the TMUX_PANE environment variable and accept it as a
target. Suggested by and with testing and tweaks from Ben Boeckel.
2011-03-27 20:27:26 +00:00
Nicholas Marriott 79e30daeae Support passing through escape sequences to the underlying terminal by
using DCS with a "tmux;" prefix. Escape characters in the sequences must
be doubled. For example:

$ printf '\033Ptmux;\033\033]12;red\007\033\\'

Will pass \033]12;red\007 to the terminal (and change the cursor colour
in xterm). From Kevin Goodsell.
2011-03-07 23:46:27 +00:00
Nicholas Marriott 7954126dcd Add a -P option to detach to HUP the client's parent process (usually
causing it to exit as well).
2011-03-03 08:51:47 +00:00
Nicholas Marriott db7a89b1ee Simplify the way jobs work and drop the persist type, so all jobs are
fire-and-forget.

Status jobs now managed with two trees of output (new and old), rather
than storing the output in the jobs themselves. When the status line is
processed any jobs which don't appear in the new tree are started and
the output from the old tree displayed. When a job finishes it updates
the new tree with its output and that is used for any subsequent
redraws. When the status interval expires, the new tree is moved to the
old so that all jobs are run again.

This fixes the "#(echo %H:%M:%S)" problem which would lead to thousands
of identical persistent jobs and high memory use (this can still be
achieved by adding "sleep 30" but that is much less likely to happen by
accident).
2011-01-26 01:54:56 +00:00
Nicholas Marriott 4dfb29fa38 Use LIST_* not SLIST_*. 2011-01-26 00:11:47 +00:00
Nicholas Marriott ecc22c521d When clearing the entire screen, clear lines that are used into the
history like xterm does. Requested ages ago by someone I've forgotten.
2011-01-25 23:40:26 +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
Nicholas Marriott b8023044c3 Set $TMUX without the session when background jobs are run. 2011-01-23 11:03:43 +00:00
Nicholas Marriott 8f8e81c0c9 Mouse highlight mode (1001) requires a program to cooperate so
supporting it through tmux is not as easy as this, remove it for now.
2011-01-15 00:16:00 +00:00
Nicholas Marriott 69cb1f830e Move all calls to fcntl(...O_NONBLOCK) into a function and clear the
flag on the stdio file descriptors before closing them (fixes things
like "tmux ls && cat").
2011-01-08 01:52:36 +00:00
Nicholas Marriott 7502cb3adb Clean up and simplify tmux command argument parsing.
Originally, tmux commands were parsed in the client process into a
struct with the command data which was then serialised and sent to the
server to be executed. The parsing was later moved into the server (an
argv was sent from the client), but the parse step and intermediate
struct was kept.

This change removes that struct and the separate parse step. Argument
parsing and printing is now common to all commands (in arguments.c) with
each command left with just an optional check function (to validate the
arguments at parse time), the exec function and a function to set up any
key bindings (renamed from the old init function).

This is overall more simple and consistent.

There should be no changes to any commands behaviour or syntax although
as this touches every command please watch for any unexpected changes.
2011-01-04 00:42:46 +00:00
Nicholas Marriott ac3b78a841 Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262
and supports larger terminals than the older way.

If the new mouse-utf8 option is on, UTF-8 mouse input is enabled for all
UTF-8 terminals. The option defaults to on if LANG etc are set in the
same manner as the utf8 option.

With help and based on code from hsim at gmx.li.
2011-01-03 23:35:21 +00:00
Nicholas Marriott 3e8124009f Move the user-visible parts of all options (names, types, limit, default
values) together into one set of tables in options-table.c. Also clean
up and simplify cmd-set-options.c and move a common print function into
option-table.c.
2011-01-01 16:51:21 +00:00
Nicholas Marriott 67ee86085c Sprinkle a little more const. 2011-01-01 03:39:21 +00:00
Nicholas Marriott 5d0cfe079b Another table that should be const. 2011-01-01 03:32:28 +00:00