Commit Graph

127 Commits (879de25583a5a0bce57bd816ced96e0caf62c436)

Author SHA1 Message Date
nicm 8e9b6e0948 Style spacing nits. 2015-05-07 11:42:56 +00:00
nicm 31b1ab4852 Add a format window_linked which is 1 if a window has been linked
multiple times, also remove the default space in window_flags and use a
conditional to add it in window-status-format (this means additional
flags can be added in the option without extra spaces). From Thomas Adam
with tweaks by me.
2015-05-06 08:35:39 +00:00
nicm 771744426e Add select-layout -o to undo the last layout change (apply the previously
set layout).
2015-04-28 10:43:13 +00:00
nicm 05e7fbd60f Get rid of window_choose_list type. 2015-04-25 18:56:05 +00:00
nicm 07dfdb974d Make message log a TAILQ. 2015-04-25 18:33:59 +00:00
nicm 6dbd63ba4f Move the functions to convert ids from strings into session.c and window.c. 2015-04-25 18:09:28 +00:00
nicm 8d66f4fba4 Change the windows array into an RB tree and fix some places where we
were only looking at the first winlink for a window in a session.
2015-04-22 15:30:11 +00:00
nicm 89e80cabd5 window_index is only used in one place (window_destroy) so inline it there. 2015-04-22 15:05:03 +00:00
nicm 69f292a90e Always format real layout even when zoomed. 2015-04-21 22:38:49 +00:00
nicm 6f587570ed Use a more sensible buffer size for flags string. 2015-04-20 07:50:49 +00:00
nicm bf635e7741 Rewrite of tmux mouse support which was a mess. Instead of having
options for "mouse-this" and "mouse-that", mouse events may be bound as
keys and there is one option "mouse" that turns on mouse support
entirely (set -g mouse on).

See the new MOUSE SUPPORT section of the man page for description of the
key names and new flags (-t= to specify the pane or window under mouse
as a target, and send-keys -M to pass through a mouse event).

The default builtin bindings for the mouse are:

    bind -n   MouseDown1Pane select-pane -t=; send-keys -M
    bind -n MouseDown1Status select-window -t=
    bind -n   MouseDrag1Pane copy-mode -M
    bind -n MouseDrag1Border resize-pane -M

To get the effect of turning mode-mouse off, do:

    unbind -n MouseDrag1Pane
    unbind -temacs-copy MouseDrag1Pane

The old mouse options are now gone, set-option -q may be used to
suppress warnings if mixing configuration files.
2015-04-19 21:34:21 +00:00
nicm ee123c2489 Support setting the default window and pane background colours (window
and active pane via window-style and window-active-style options, an
individual pane by a new select-pane -P flag). From J Raynor.
2015-04-19 21:05:27 +00:00
nicm 1b2c62afe9 Entries in the window list can be NULL, prompted by a crash seen by Ben
Boeckel.
2015-02-09 12:47:18 +00:00
nicm 160e3e2be3 Notify on zoom/unzoom, from George Nachmann. 2014-12-15 10:04:18 +00:00
nicm a02c2e55c0 Only redraw pane when it has actually changed. 2014-10-21 22:22:04 +00:00
nicm f518a077b1 Add flags to selectp to enable and disable input to a pane, from Anish
Athalye.
2014-08-11 22:14:30 +00:00
nicm 54782af616 Allow keys and send-keys to invisible panes, from saggy-kun at users dot
sf dot net.
2014-06-23 10:27:05 +00:00
nicm 74becbfd6f Reset properly when c0-change-trigger is increased from zero so panes
don't get stuck.
2014-06-05 22:14:29 +00:00
nicm b3e8d440ed If multiple arguments are given to new-session, new-window,
split-window, respawn-window or respawn-pane, pass them directly to
execvp() to help avoid quoting problems. One argument still goes to "sh
-c" like before. Requested by many over the years. Patch from J Raynor.
2014-05-13 08:08:32 +00:00
nicm 540f0b3e45 Both the two previous ways of navigating panes by direction have
irritating flaws:

a) The old way of always using the top or left if the choice is
ambiguous is annoying when the layout is unbalanced.

b) The new way of remembering the last used pane is annoying if the
layout is balanced and the leftmost is obvious to the user (because
clearly if we go right from the top-left in a tiled set of four we want
to end up in top-right, even if we were last using the bottom-right).

So instead, use a combination of both: if there is only one possible
pane alongside the current pane, move to it, otherwise choose the most
recently used of the choice.
2014-05-08 06:03:30 +00:00
nicm a5d4b7f3d9 Some more long lines. 2014-04-17 14:45:49 +00:00
nicm 3e27be353d Set PATH explicitly, either from client or session
environment. Previously it came from the session environment. From J
Raynor.
2014-04-17 13:02:59 +00:00
nicm bce952777a Remove some unnecessary includes and fix a typo. 2014-04-17 11:38:35 +00:00
nicm 2e98c9057d Correct the dance to fix the active pane in join-pane by pulling the
(right) code from break-pane and window_remove_pane into a helper
function.
2014-04-17 09:13:13 +00:00
nicm 992ef70fb6 Remove the monitor-content option and associated bits and bobs. It's
never worked very well. If there is a big demand for it to return, will
consider better ways to do it.
2014-04-17 07:36:45 +00:00
nicm 1704d4a6b7 Don't segfaut when the parent of the layout cell is NULL, from Thomas Adam. 2014-03-31 21:41:07 +00:00
nicm 315d45a0eb Fix crash due to uninitialized lastwp member of layout_cell, reported by
Balazs Kezes.
2014-02-22 18:01:10 +00:00
nicm 945339b443 Allow replacing each of the many sets of separate foo-{fg,bg,attr}
options with a single foo-style option. For example:

    set -g status-fg yellow
    set -g status-bg red
    set -g status-attr blink

Becomes:

    set -g status-style fg=yellow,bg=red,blink

The -a flag to set can be used to add to rather than replace a style. So:

    set -g status-bg red

Becomes:

    set -ag status-style bg=red

Currently this is fully backwards compatible (all *-{fg,bg,attr} options
remain) but the plan is to deprecate them over time.

From Tiago Cunha.
2014-01-28 23:07:09 +00:00
nicm c930fd5ff6 Remember the last active pane in the top-bottom or left-right cell so
that it can be restored when moving back to that cell with selectp
-L/-R/etc. From Suraj N Kurapati.
2014-01-28 22:19:17 +00:00
nicm 282c5f9644 Alter how tmux handles the working directory to internally use file
descriptors rather than strings.

- Each session still has a current working directory.

- New sessions still get their working directory from the client that
  created them or its attached session if any.

- New windows are created by default in the session working directory.

- The -c flag to new, neww, splitw allows the working directory to be
  overridden.

- The -c flag to attach let's the session working directory be changed.

- The default-path option has been removed.

To get the equivalent to default-path '.', do:

        bind c neww -c $PWD

To get the equivalent of default-path '~', do:

        bind c neww -c ~

This also changes the client identify protocol to be a set of messages rather
than one as well as some other changes that should make it easier to make
backwards-compatible protocol changes in future.
2013-10-10 12:26:34 +00:00
nicm 90ae7682ed Clear window->flags when clearing winlinks
When clearing WINLINK_ALERTFLAGS for all sessions, we must also, for
that window, clear the window->flags as well, otherwise sessions may
well still see flags for winlinks long since cleared.

This therefore introduces WINDOW_ALERTFLAGS to help with this.
2013-10-10 11:59:23 +00:00
Nicholas Marriott 771d7db3a6 Fix compiler warnings, missing #include. From Thomas Adam. 2013-03-26 10:54:48 +00:00
Nicholas Marriott e44bd9f750 Revert the command-prefix change which breaks sequences of commands. 2013-03-25 15:59:57 +00:00
Nicholas Marriott 58bb6f8c56 Set pane resize flag when needed. 2013-03-25 11:55:01 +00:00
Nicholas Marriott 114d822d27 Don't zoom windows with one pane, from Romain Francoise. 2013-03-25 11:39:11 +00:00
Nicholas Marriott c71844de63 Add resize-pane -Z to temporary zoom the active pane to occupy the full
window or unzoom (restored to the normal layout) if it already zoomed,
bound to C-b z by default. The pane is unzoomed on pretty much any
excuse whatsoever.

We considered making this a new layout but the requirements are quite
different from layouts so decided it is better as a special case. Each
current layout cell is saved, a temporary one-cell layout generated and
all except the active pane set to NULL.

Prompted by suggestions and scripts from several. Thanks to Aaron Jensen
and Thiago Padilha for testing an earlier version.
2013-03-24 09:57:59 +00:00
Nicholas Marriott 3eae71b5b2 Do pane resize ioctls once at the end of the server loop rather than
immediately.
2013-03-24 09:25:04 +00:00
Nicholas Marriott 8d59b189cc No more lint means no more ARGSUSED. 2013-03-22 10:31:22 +00:00
Nicholas Marriott 8903c1f167 Automatically reflow wrapped lines when a pane is resized, requested by
many over the years and finally implemented by Richard Woodbury.
2013-02-05 11:08:59 +00:00
Nicholas Marriott e33ba57c13 Remove the layout undo/redo code which never really worked. 2013-01-17 00:11:22 +00:00
Nicholas Marriott 24d7d073ff Support the 47 and 1047 SM and RM sequences (alternate screen without
cursor), requested by I forget who ages ago.
2012-11-27 20:08:42 +00:00
Nicholas Marriott d210d99cce Make mouse event structure clearer by defining events (up, click, drag)
and simplifying how buttons and wheels are represented, from Ailin
Nemui. Should be no functional changes.
2012-10-26 14:35:42 +00:00
Nicholas Marriott 596e9d8068 Fix bad size in memcpy from Romain Francoise. 2012-10-25 11:14:46 +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
Nicholas Marriott a3dec6bece Instead of numbering choose mode items 0-9a-z and then nothing, number
them all and if there are more than 10 use a prompt when 0-9 is
pressed. From Thomas Adam.
2012-08-11 06:45:33 +00:00
Nicholas Marriott df912e3540 xfree is not particularly helpful, remove it. From Thomas Adam. 2012-07-10 11:53:01 +00:00
Nicholas Marriott 63f5c38023 Clear flags across all sessions, from Thomas Adam. 2012-07-08 07:27:32 +00:00
Nicholas Marriott f51c55c3f0 Use default-shell not _PATH_BSHELL to spawn commands, pointed out by
Dennis G?nnewig and Thomas Adam.
2012-05-28 08:55:43 +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
Nicholas Marriott c829bdf537 Minor style nits - return (). 2012-04-01 20:53:47 +00:00