Commit Graph

83 Commits

Author SHA1 Message Date
Tiago Cunha
0027aa3d1e Sync OpenBSD patchset 278:
Don't read beyond the edge of the screen when searching (dies with debug
enabled).
2009-08-20 11:52:39 +00:00
Tiago Cunha
aa7c0f1ce8 Sync OpenBSD patchset 266:
Nuke unnecessary assignment.
2009-08-20 11:23:36 +00:00
Tiago Cunha
2a5f08c15a Sync OpenBSD patchset 265:
Add a "delete line" key when editing in the status line or the search up/down
prompt. C-u with emacs keys, d with vi.
2009-08-20 11:22:48 +00:00
Tiago Cunha
70fc085862 Sync OpenBSD patchset 264:
Add (naive) searching and goto line in copy mode. Searching is C-r and C-s with
emacs keys, / and ? with vi; n repeats the search again with either key
set. All searching wraps the top/bottom. Goto line is g for both emacs and vi.

The search prompts don't have full line editing, just simple append and delete
characters.

Also sort the mode keys list in tmux.1.
2009-08-20 11:20:24 +00:00
Tiago Cunha
6f9a2ee50a Sync OpenBSD patchset 260:
vi(1)-style half page scroll in copy and scroll modes. Move the vi full page
scroll key to C-b instead of C-u and use C-u/C-d for half page scrolling with
vi keys. In emacs mode, half page scrolling is bound to M-Up and M-Down.

Suggested by merdely (about a year ago :-)).
2009-08-16 19:26:49 +00:00
Tiago Cunha
98e9e09588 Sync OpenBSD patchset 259:
Scroll by two less than the number of lines in the screen, like emacs, rather
than by the entire screen, to make it easier to pull things out from under the
line indicator. Suggested by claudio.
2009-08-16 19:23:07 +00:00
Tiago Cunha
9116905b24 Sync OpenBSD patchset 256:
Allowing copy mode to scroll left and right is annoying, so limit it to the
real screen width. To indicate the cursor is at the end of the line rather than
the cell before, put a '$' in the last cell.

Also clear the selection when the terminal is resized to avoid tmux getting
confused.
2009-08-16 19:12:07 +00:00
Tiago Cunha
ba42910595 Sync OpenBSD patchset 253:
Redraw the screen after resizing.
2009-08-14 21:33:42 +00:00
Tiago Cunha
97eb537f38 Sync OpenBSD patchset 227:
Add a flags member to the grid_line struct and use it to differentiate lines
wrapped at the screen edge from those terminated by a newline. Then use this
when copying to combine wrapped lines together into one.
2009-08-09 17:32:06 +00:00
Tiago Cunha
37b0bcd7c1 Sync OpenBSD patchset 226:
Change the way the grid is stored, previously it was:

- a two-dimensional array of cells;
- a two-dimensional array of utf8 data;
- an array of line lengths.

Now it is a single array of a new struct grid_line each of which represents a
line and contains the length and an array of cells and an array of utf8 data.

This will make it easier to add additional per-line members, such as flags.
2009-08-09 17:28:24 +00:00
Tiago Cunha
88b83be07b Sync OpenBSD patchset 220:
If colours are not supported by the terminal, try to emulate a coloured
background by setting or clearing the reverse attribute.

This makes a few applications which don't use the reverse attribute themselves
a little happier, and allows the status, message and mode options to have
default attributes and fg/bg options that work as expected when set as reverse.
2009-08-09 16:50:57 +00:00
Tiago Cunha
ec3dba01b2 Sync OpenBSD patchset 198:
Add a mode-mouse option to prevent tmux taking over the mouse in choice or
copy modes.
2009-07-30 20:32:05 +00:00
Tiago Cunha
de7483a114 Sync OpenBSD patchset 192:
Next step towards customisable mode keys: build each default table of keys
into a named tree on start and use that for lookups. Also add command to string
translation tables and modify list-keys to show the mode key bindings (new
-t argument).
2009-07-28 23:11:18 +00:00
Tiago Cunha
1c73e75982 Sync OpenBSD patchset 190:
Remove an unused entry in the mode keys command enum and rename
MODEKEYCOPY_QUIT to _CANCEL to match the others.
2009-07-28 22:58:20 +00:00
Tiago Cunha
920b9c5872 Sync OpenBSD patchset 189:
Change mode key bindings from big switches into a set of tables. Rather than
lumping them all together, split editing keys from those used in choice/more
mode and those for copy/scroll mode.

Tidier and clearer, and the first step towards customisable mode keys.
2009-07-28 22:55:59 +00:00
Tiago Cunha
1880b83c37 Sync OpenBSD patchset 188:
Get rid of empty mode_key_free function.
2009-07-28 22:49:26 +00:00
Tiago Cunha
2a146852ef Sync OpenBSD patchset 185:
Change previous-word behavior to move to the beginning of the word (matches
emacs and vi). From Kalle Olavi Niemitalo.
2009-07-28 22:39:29 +00:00
Tiago Cunha
2e4df706f6 Sync OpenBSD patchset 171:
Redraw after starting selection to correctly remove any existing selection.
2009-07-23 23:37:14 +00:00
Nicholas Marriott
5ef5bd7c31 Add a "back to indentation" key in copy mode to move the cursor to the first
non-whitespace character. ^ with vi and M-m with emacs key bindings. Another
from Kalle Olavi Niemitalo, thanks.
2009-07-14 06:39:25 +00:00
Nicholas Marriott
7f98193beb Merge three copies of identical code to move the cursor x position into a
single function, from Kalle Olavi Niemitalo.
2009-07-14 06:38:32 +00:00
Nicholas Marriott
d8de72ca77 Copy was using the real line length which after resize can be larger than the
screen width. When built with -DDEBUG, this made the grid bounds checking code
kill the server. Restrict copying to the actual width.

From Kalle Olavi Niemitalo, thanks.
2009-07-12 17:11:07 +00:00
Nicholas Marriott
d4a143a425 Stop in the right place so all the lines selected are copied. Reported by Kalle
Olavi Niemitalo, thanks.
2009-07-12 16:56:56 +00:00
Nicholas Marriott
29ac832cb3 Fix two copy/paste bugs: forbid zero-length buffers to prevent a fatal error
when trying to paste them, found by me, and miscalculation of the start/end
causing random fatal errors when copying in copy-mode, reported by sthen.
2009-07-02 16:23:54 +00:00
Nicholas Marriott
143aa718e5 Space trimmage mega-diff. 2009-05-04 17:58:27 +00:00
Nicholas Marriott
9bdba2e84f Er, i should be j and c should be u. 2009-03-31 15:10:43 +00:00
Nicholas Marriott
b0dc1712ec UTF8_SIZE. 2009-03-31 12:28:45 +00:00
Nicholas Marriott
aecded5da0 Copy columns correctly. 2009-03-30 21:08:04 +00:00
Nicholas Marriott
fb5a92ff9f Only need to print this once... 2009-03-30 20:58:25 +00:00
Nicholas Marriott
8a160f2d58 - Unbreak selection colouring.
- Get UTF-8 check the right way round...
2009-03-30 20:14:50 +00:00
Nicholas Marriott
e2a7ac4b36 Fix UTF-8 in c&p mode. 2009-03-30 19:57:02 +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
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
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
2057e666a2 Mouse in copy mode. 2009-01-28 22:00:22 +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
Nicholas Marriott
c6bd9e2063 Allow status, mode and message attributes to be changed by three new options: status-attr, mode-attr, message-attr. A comma-separataed list is accepted containing: bright, dim, underscore, blink, reverse, hidden, italics, for example: set -g status-attr bright,blink
From Josh Elsasser, thanks!
2009-01-27 20:22:33 +00:00
Tiago Cunha
d60ad6f483 Make the caller responsible for allocating memory for the paste buffer data
(needed by the load-buffer command when dealing with big files since it'll
prevent tmux from dying due to memory exhaustion). From nicm.
2009-01-25 18:51:28 +00:00
Nicholas Marriott
e0861a2cd0 Missed a reverse. 2009-01-23 20:50:58 +00:00
Nicholas Marriott
6146cab3bd Use reverse so status line etc works in terminals w/o colour. 2009-01-23 20:49:01 +00:00
Nicholas Marriott
7118baa340 Allow a selection in vi keys mode... 2009-01-21 18:19:32 +00:00
Nicholas Marriott
0691217742 These should be u_int. 2009-01-18 15:40:19 +00:00
Nicholas Marriott
c4d5989a4e This is fixed. 2009-01-18 13:20:46 +00:00
Nicholas Marriott
440a84b2aa Use -O0 to prevent copy issues. 2009-01-12 00:52:37 +00:00
Nicholas Marriott
162bacdcd9 Window splitting. Two vertical panes fixed 50% each. This is a huge diff, still a couple of bugs (notably heap corruption somewhere causing segfault on exit). 2009-01-11 23:31:46 +00:00
Nicholas Marriott
88ab74ac20 Clock mode. 2009-01-10 19:35:40 +00:00
Nicholas Marriott
a1b43faa43 Trim spaces. 2009-01-10 01:51:22 +00:00
Nicholas Marriott
f26c691b08 Should redraw 1 too. 2008-12-11 21:10:04 +00:00
Nicholas Marriott
7a82e86827 Make window options work the same was as session options, add mode-fg/mode-bg options, force -g for global on set/show/setw/showw/ 2008-12-08 16:19:51 +00:00