Commit Graph

403 Commits (cd5294dfb46df5e381a9cdc7672f60713e776301)

Author SHA1 Message Date
Nicholas Marriott eee3dd297e New command, if-shell (alias if). Executes the tmux command in the second
argument if the shell command in the first succeeds, for example:

       if "[ -e ~/.tmux.conf.alt ]" "source .tmux.conf.alt"

Written by Tiago Cunha, many thanks.
2009-07-09 18:14:18 +00:00
Nicholas Marriott e073441c36 Tidy by removing unused argument from grid_view_{insert,delete}_line_region
functions (currently don't fully work, this is to make fix easier).
2009-07-09 18:04:17 +00:00
Nicholas Marriott 2ddcb51df3 Fix $Id$. 2009-07-08 18:03:03 +00:00
Nicholas Marriott 86504af149 Rename the global options variables to be shorter and to make session options
clear. No functional change, getting this out of the way to make later options
changes easier.
2009-07-08 18:01:31 +00:00
Nicholas Marriott 08c7249636 Change default_window_name to use window_default_command if the actual cmd is
empty. From Josh Elsasser.
2009-07-02 18:17:46 +00:00
Nicholas Marriott 9f0653386b $Id$. 2009-07-01 23:06:32 +00:00
Nicholas Marriott eed4f7600d Fix $Id$. 2009-06-29 22:04:51 +00:00
Nicholas Marriott 1496aa5dbc Remove some unused function declarations; no binary change. 2009-06-26 22:18:03 +00:00
Nicholas Marriott 81b4aca934 #ifndef nitems. 2009-06-26 15:31:15 +00:00
Nicholas Marriott 802e129fd7 Start of portability update: bitstring.h. 2009-06-25 17:02:59 +00:00
Nicholas Marriott a9e3d5c56a More diff-to-OpenBSD reduction. Move a lot of compat stuff into compat.h. 2009-06-25 16:47:00 +00:00
Nicholas Marriott bb459beb03 Whitespace and more syncing. 2009-06-25 16:34:50 +00:00
Nicholas Marriott 6cde05147e No more xmalloc-debug. 2009-06-25 16:25:15 +00:00
Nicholas Marriott a5830b9603 Restore $Id$ and add script to do so. 2009-06-25 16:21:32 +00:00
Nicholas Marriott 1b9ac18565 tmux doesn't and won't need syslog logging, so remove it and some other unused
functions found by lint.
2009-06-25 16:09:25 +00:00
Nicholas Marriott 582660bdf3 Miscellaneous unused functions, including one which was basically a
duplicate. Found by lint.
2009-06-25 16:09:11 +00:00
Nicholas Marriott 62822b1848 Nuke unused buffer functions. Found by lint.
Also remove some old debug output which was #if 0.
2009-06-25 16:07:00 +00:00
Nicholas Marriott f7a9eb46fc Change find-window and monitor-content to use fnmatch(3). For convenience and
compatibility, *s are implicitly added at the start and end of the pattern.
2009-06-25 16:04:24 +00:00
Nicholas Marriott 853ad68162 Add a dedicated function to convert a line into a string and use it to simplify the search window function. 2009-06-25 16:02:37 +00:00
Nicholas Marriott 942ea4267d Trying to predict the cursor position for UTF-8 output in the same way as for
normal eight-bit output is wrong, separate it into a different function. Fixes
spacing when mixing UTF-8 with some escape sequences, notably the way w3m does
it.
2009-06-25 16:01:26 +00:00
Nicholas Marriott 245685433e Constify utf8_width() function argument. 2009-06-25 16:00:50 +00:00
Nicholas Marriott 1b245388b5 Proper support for tab stops (\033H etc), using a bitstring(3). Makes another
vttest test happy.
2009-06-25 15:54:38 +00:00
Nicholas Marriott 93631b3ca7 Implement the DEC alignment test. With the last change this is enough for the
first cursor test in vttest (in ports) to pass; it still shops a few more
problems though.
2009-06-25 15:51:54 +00:00
Nicholas Marriott 28bcf774e5 New session option, status-utf8, to control the interpretation of top-bit-set
characters in status-left and status-right (if on, they are treated as UTF-8;
otherwise passed through).
2009-06-25 15:48:25 +00:00
Nicholas Marriott 1e06ec41dc Add a UTF-8 aware string length function and make UTF-8 in
status-left/status-right work properly. At the moment any top-bit-set
characters are assumed to be UTF-8: a status-utf8 option to configure this will
come shortly.
2009-06-25 15:47:07 +00:00
Nicholas Marriott 0828e06ad7 Nuke unused pane flag. 2009-06-25 15:46:09 +00:00
Nicholas Marriott 3a55871d04 Now in base. 2009-05-26 18:31:10 +00:00
Nicholas Marriott 6c442c19ba UPPER -> BIG, sort, and bump protocol version. 2009-05-21 19:46:00 +00:00
Nicholas Marriott 6db7bd6791 Try to guess if the window is UTF-8 by outputting a three-byte UTF-8 wide character and seeing how much the cursor moves. Currently tries to figure out if this works by some stupid checks on the terminal, these need to be rethought. Also might be better using a width 1 character rather than width 2. 2009-05-19 16:08:35 +00:00
Tiago Cunha 80af85a102 - New window option monitor-content to search for a string in a window, and
highlight the status line if it matches.
- To make this possible, the function cmd_find_window_search from
  cmd-find-window.c had to be moved to window.c and renamed window_pane_search.
- While there use three new functions in server.c to check for bell, activity,
  and content, to avoid too much nesting.
2009-05-19 13:32:55 +00:00
Nicholas Marriott 6e4b947d71 New option main-pane-width to set width of pane in left-vertical mode. 2009-05-18 21:55:53 +00:00
Nicholas Marriott 404411f5e7 horizontal -> h, vertical -> v, to shorten some function names a little. 2009-05-18 21:29:11 +00:00
Nicholas Marriott d601c42ea2 Behave properly when resize not supported. 2009-05-18 21:16:09 +00:00
Nicholas Marriott 5518b6138d manual -> manual-vertical. 2009-05-18 21:06:16 +00:00
Nicholas Marriott ab4e5e8574 Clean up manual layout code:
- change the one layout function into two _refresh and _resize
- create layout-manual.c for manual layout code
- move the fit panes/update panes code from window.c to the new file as it is only used by manual layout now
- move the resize pane code into layout-manual.c as well
- get rid of the direct calls to fit/update and make them go through layout
- rename a couple of variables

This is mainly as a first step before reworking the manual layout code to see if anything breaks.
2009-05-18 21:01:38 +00:00
Nicholas Marriott 1001902143 select-layout command and some key bindings. 2009-05-16 11:48:47 +00:00
Nicholas Marriott 03af7c99b5 Recreate server socket on SIGUSR1, per SF feature request 2792533. 2009-05-16 10:02:51 +00:00
Nicholas Marriott cba338ac13 Keys in status line (p in vi mode, M-y in emacs) to paste the first line of the upper paste buffer. Suggested by Dan Colish. 2009-05-14 19:36:56 +00:00
Nicholas Marriott 96ca072482 clear-history command. 2009-05-14 16:56:23 +00:00
Nicholas Marriott c8cf438d44 Rename all feature flags to HAVE_* and move out of makefiles into a configure
script which must be run before building.

Still two makefiles but they are a hell of a lot simpler.

HAVE_* also will make it easier to move to $buildsystem if necessary later.
2009-05-13 23:27:00 +00:00
Nicholas Marriott 792aeb926e Use getopt.c from openssh rather than OpenBSD's getopt_long. 2009-05-13 22:20:48 +00:00
Nicholas Marriott 143aa718e5 Space trimmage mega-diff. 2009-05-04 17:58:27 +00:00
Nicholas Marriott fb543c7707 Use ACS for line drawing characters. 2009-05-04 13:20:02 +00:00
Nicholas Marriott 9164dd63e7 Only worry about complete seconds for status line update. Also reduce poll interval and de-magic-number it. 2009-05-02 08:34:39 +00:00
Nicholas Marriott 044e6f7660 previous-layout command. 2009-04-30 21:17:06 +00:00
Nicholas Marriott a6f2d82335 Use a (pre)randomised binary tree for UTF-8 character widths. Probably overkill
but meh.
2009-04-30 20:54:53 +00:00
Nicholas Marriott a583bbb730 Display the layout name in window lists. 2009-04-30 16:27:29 +00:00
Nicholas Marriott cdf472f2de Merge resize-pane-{up,down} into resize-pane. 2009-04-30 06:01:24 +00:00
Nicholas Marriott cc9cc1aea8 Some tweaks for Solaris.
Get rid of vis.* in favour of a small replacement function.
2009-04-29 22:25:20 +00:00
Nicholas Marriott f0a716f484 Use a u_char so top-bit-set update the cursor as well. 2009-04-29 17:50:52 +00:00
Nicholas Marriott 5d1b6888dc Convert hidden flag to a full flags word for the status line and add a flag to
accept after only one key. Use this so don't need to press enter after y/n for
confirm-before.
2009-04-27 17:27:36 +00:00
Nicholas Marriott d8a35ffa50 Perform some black and midnight cpp witchcraft to get rid of GRID_DEBUG, to fix
building with -DDEBUG on gcc2 platforms. From joshe.
2009-04-27 14:51:59 +00:00
Tiago Cunha 058772e4e6 - confirm-before command.
- Bound "&" and "x" by default to confirm-before "kill-window" and
  confirm-before "kill-pane", respectively.
2009-04-27 13:21:16 +00:00
Nicholas Marriott 5fbdca890a Use the xenl terminfo flag to detect early-wrap terminals like the FreeBSD
console. Many thanks for a very informative email from Christian Weisgerber.
2009-04-23 21:09:17 +00:00
Nicholas Marriott 325d43e417 rotate-window command. 2009-04-03 17:21:46 +00:00
Nicholas Marriott 8216f7b3d9 swap-pane command. 2009-04-02 23:28:16 +00:00
Nicholas Marriott dbf52facd2 Change scroll/pane redraws to only redraw the single pane affected rather than
the entire window.
2009-04-02 21:08:15 +00:00
Nicholas Marriott 84cde92c8f If redrawing the region would mean redrawing > half the pane, just schedule to
redraw the entire window. Also add a flag to skip updating the window any
further if it is scheduled to be redrawn. This has the effect of batching
multiple redraws together.
2009-04-02 20:30:23 +00:00
Nicholas Marriott 91bc6836f7 - Allow switching to hidden windows (for active-only layout).
- Don't update unnecessarily for other layouts when changing active pane doesn't matter.
2009-04-01 21:10:08 +00:00
Nicholas Marriott b6450b167b Basic horizontal splitting and layout management. Still some redraw and other
issues - particularly, don't mix with manual pane resizing and be careful when
viewing from multiple clients; generally cycling the layout a few times will
fix most problems. Getting this in for testing while I think about how to deal
with manual mode.

Split window as normal and cycle the layouts with C-b space. Some of the
layouts will work better when swap-pane comes along.
2009-04-01 18:21:42 +00:00
Nicholas Marriott d13add828a More AIX tweaks. 2009-03-31 22:08:45 +00:00
Nicholas Marriott 23fef99009 8 -> UTF8_SIZE. 2009-03-29 11:18:28 +00:00
Nicholas Marriott cf7b384c43 Better UTF-8 support, including combined characters. Unicode data is now stored
as UTF-8 in a separate array, the code does a lookup into this every time it
gets to a UTF-8 cell. Zero width characters are just appended onto the UTF-8
data for the previous cell. This also means that almost no bytes extra are
wasted non-Unicode data (yay).

Still some oddities, such as copy mode skips over wide characters in a strange
way, and the code could do with some tidying.
2009-03-28 20:17:29 +00:00
Nicholas Marriott 34dd72f008 _fill functions are no longer needed. Nuke them. 2009-03-28 16:57:03 +00:00
Nicholas Marriott abf170d6d0 Whoops. Missed a few changes. 2009-03-28 16:55:46 +00:00
Nicholas Marriott 6c0728fe07 Step 2 of the Grand Plan To Make UTF-8 Better.
Split grid into two arrays, one containing grid attributes/flags/colours (keeps
the name grid_cell for now) and a separate with the character data (called
text). The text is stored as a u_short but is treated as a uint64_t elsewhere;
eventually the grid will have two arrays.

I'm not happy with the naming so that might change.

Still need to decide where to go from here. I'm not sure whether to combine
the peek/set functions together, and also whether to continue to treat the
text as a uint64_t (and convert to/from Unicode) or make it a char array
(of size one when UTF-8 disabled, eight when enabled) and keep everything
as UTF-8.

Also since UTF-8 will eventually become an attribute of the grid itself it
might be nice to move all the padding crap into grid.c.
2009-03-28 16:30:05 +00:00
Nicholas Marriott 989d67ccd7 struct grid_data -> struct grid. Stage 1 of the Grand Plan To Make UTF-8 Better. 2009-03-28 15:43:41 +00:00
Nicholas Marriott cb2ac5c269 Key repeating is now a property of the key binding not of the command. Repeat
is turned on when the key is bound with the -r flag to bind-key. next/previous-
window no longer repeat by default as it turned out to annoy me.
2009-03-28 14:08:09 +00:00
Nicholas Marriott 587badecdb Clear using ED when redrawing the screen. I foolishly assumed using spaces
would be equivalent and terminals would pick up on this, but apparently
not. This fixes copy and paste in xterm/rxvt.
2009-03-28 10:15:01 +00:00
Nicholas Marriott a7f57773b7 Not const. 2009-03-27 17:04:04 +00:00
Nicholas Marriott f6001f9ffc Whoops. Didn't mean to commit this yet. 2009-03-27 16:44:51 +00:00
Nicholas Marriott b97264bb70 Update TODO. 2009-03-27 16:44:00 +00:00
Nicholas Marriott be0c79f3ad Sockets in /tmp are now created in a subdirectory named, tmux-UID, eg
tmux-1000. The default socket is thus /tmp/tmux-UID/default. To start a
separate server, the new -L command line option should be used: this creates a
socket in the same directory with a different name ("-L main" will create
socket called "main"). -S should only be used to place the socket outside
/tmp. This makes sockets a little more secure and a bit more convenient to use
multiple servers.
2009-03-27 15:57:10 +00:00
Nicholas Marriott f5f04a9344 * New session flag "set-remain-on-exit" to set remain-on-exit flag for new windows created in that session (like "remain-by-default" used to do). Not perfectly happy about this, but until I can think of a good way to introduce it generically (maybe a set of options in the session) this will do. Fixes SF request 2527847. 2009-03-21 12:44:06 +00:00
Nicholas Marriott e6d35b6aa4 Support for 88 colour terminals. 2009-03-07 10:29:06 +00:00
Nicholas Marriott 56f80a5b09 break-pane command to split a pane off into a new window; bound to ! by default. 2009-03-07 09:29:54 +00:00
Nicholas Marriott 65b9aeb337 Put socket path in $TMUX. 2009-03-04 17:24:07 +00:00
Nicholas Marriott 171256057e Extra function keys from Dashing dashing at hushmail dot com 2009-03-02 18:05:40 +00:00
Nicholas Marriott 57f5f44d0f Sort out escape key handling so it works. 2009-03-02 16:55:23 +00:00
Nicholas Marriott afd67ce89f Allow selection in vi mode. 2009-02-21 17:46:13 +00:00
Nicholas Marriott 95c8c049f5 Redo mode keys slightly more cleanly and apply them to command prompt editing. vi or emacs mode is controlled by the session option status-keys. 2009-02-13 21:39:45 +00:00
Nicholas Marriott 0450b4a5d4 Move status prompt/message init and teardown into status.c. 2009-02-13 18:57:55 +00:00
Nicholas Marriott cce03e138b Looking up argv[0] is expensive, so just use p_comm for the window name which is good enough. Also increase name update time to 500 ms. 2009-02-13 00:43:04 +00:00
Nicholas Marriott 959eeef505 FreeBSD's console wraps lines at $COLUMNS - 1 rather than $COLUMNS (the cursor can never be beyond $COLUMNS - 1) and does not appear to support changing this behaviour, or any of the obvious possibilities (turning off right margin wrapping, insert mode). This is irritating, most notably because it impossible to write to the very bottom-right of the screen without scrolling. To work around this, if built on FreeBSD and run with a "cons" $TERM, the bottom-right cell on the screen is omitted. 2009-02-11 23:16:45 +00:00
Nicholas Marriott 6c76aaca92 Lose unnecessary cursor restores, fix a couple of placement bugs and remove unused CR. 2009-02-11 18:44:08 +00:00
Nicholas Marriott 03d531ebc6 Move sx,sy into tty rather than client. 2009-02-11 17:50:36 +00:00
Nicholas Marriott 514fe11727 We are going to need the updated screen data for emulating the scroll region,
which may involve changing the cursor position; however, the old (before
redraw) cursor position is necessary for writing to the tty. So, save it before
doing the redraw then update the internal screen then update the tty.

Not sure I like this solution but it does the job for now.
2009-02-11 17:04:39 +00:00
Nicholas Marriott 91c9d95279 Change tty_cmd_* to use a window_pane. 2009-02-11 07:02:34 +00:00
Nicholas Marriott e444b0b92a Split most of tty_cmd_cell off to tty_cell. First step on making tty_cmd_* take
a window_pane for later use emulating scroll region.
2009-02-11 06:50:16 +00:00
Nicholas Marriott c6be7d3ee6 Simplify screen/tty write code to eliminate function pointer which is now
unnecessary (it always does the same thing).
2009-02-11 06:31:09 +00:00
Nicholas Marriott b37399304f Don't redraw status line unless it has actually changed. Stops extraneous
updates between clock/#() changes and doesn't require manual status-interval 0
when no updates are occuring.
2009-02-10 00:18:06 +00:00
Nicholas Marriott c9cfc9a9f3 Don't try to change the window name unless the pid of the process chosen has
changed. Reduces CPU use.

osdep-* stuff is a bit horrible now but there we go :-/.
2009-02-09 18:08:01 +00:00
Nicholas Marriott 9d90d9ad70 Increase name refresh interval to 250 ms to reduce CPU use. 2009-02-09 16:11:26 +00:00
Nicholas Marriott 62d2ab3e68 Continue process if suspended. 2009-02-08 16:11:26 +00:00
Tiago Cunha 4213ff8faa copy-buffer command. 2009-02-03 17:21:19 +00:00
Nicholas Marriott 882316ad6a Set colour of window entry in status line based on window options. 2009-01-30 00:24:49 +00:00
Nicholas Marriott 2bf9f4973b Undo this and just shut lint up. 2009-01-29 19:26:53 +00:00
Nicholas Marriott 6ad0d2ab4a Nuke debugging. 2009-01-29 19:24:34 +00:00
Nicholas Marriott 4428987e95 * Better support for at least the most common variant of mouse input: parse it and adjust for different panes. Also support mouse in window/session choice mode.
* Bring back the fancy window titles with session/window names: it is easy to work around problems with elinks (see FAQ).
2009-01-28 19:52:21 +00:00
Nicholas Marriott 2af52440ba -u to start with screen scrolled up. 2009-01-27 23:35:44 +00:00