Commit Graph

110 Commits

Author SHA1 Message Date
Tiago Cunha
646d6a929c Sync OpenBSD patchset 261:
Switch the prompt code to return an empty string when the user enters no
response and reserve NULL for an explicit cancel. Change all callbacks to treat
them the same so no functional change.

Also add cancel key bindings to emacs mode which were missing.
2009-08-16 19:29:24 +00:00
Tiago Cunha
167a8c9edc Sync OpenBSD patchset 229:
Options to set the colours and attributes for status-left/-right. From Thomas
Adam, thanks.
2009-08-09 17:40:17 +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
09c6432854 Sync OpenBSD patchset 207:
Plug some memory leaks.
2009-07-30 21:14:04 +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
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
46cb0de347 Sync OpenBSD patchset 187:
Add a key to delete to end of line at the prompt (^K in emacs mode, C/D in
vi).

From Kalle Olavi Niemitalo.
2009-07-28 22:44:38 +00:00
Tiago Cunha
2aa4d47312 Sync OpenBSD patchset 183:
Calculate the space available for the prompt buffer and the cursor position
correctly, and make it work when the screen is not wide enough.

Noticed by Kalle Olavi Niemitalo.
2009-07-28 22:32:15 +00:00
Tiago Cunha
6a97901691 Sync OpenBSD patchset 153:
Remove a couple of unused functions and fix a type ("FALLTHOUGH"), found by
lint.
2009-07-22 17:31:20 +00:00
Tiago Cunha
9a07e8f372 Sync OpenBSD patchset 147:
Add a status-justify option to allow the window list in the status line to be
positioned at the left, centre, or right.
2009-07-20 16:01:07 +00:00
Tiago Cunha
e8957009c7 Sync OpenBSD patchset 146:
New options, window-status-current-{fg,bg,attr}, to set the fg, bg and
attributes with which the current window is shown in the status line. From
Johan Friis, thanks.
2009-07-20 15:57:05 +00:00
Tiago Cunha
ae7dda10ce - New command display-message (alias display) to display a message in the
status line (bound to "i" by default).
- Add support for including the window index, pane index, and window name
  in status-left, or status-right.
- Bump protocol version.
2009-07-17 18:32:54 +00:00
Nicholas Marriott
441c118b63 Memory could be leaked if a second prompt or message appeared while another was
still present, so add a separate prompt free callback and make the _clear
function responsible for calling it if necessary (rather than the individual
2009-07-17 09:26:21 +00:00
Nicholas Marriott
ac55534055 Remove some duplicate code that was causing the status line to be redrawn even
when it hadn't changed.
2009-07-17 07:46:08 +00:00
Nicholas Marriott
222b8e6743 Make status_message_set a variadic printf-like function. No functional change -
helpful for a couple of things coming soon.
2009-07-15 17:50:11 +00:00
Nicholas Marriott
ff90170738 Having to update NSETOPTION/NSETWINDOWOPTION when adding new options is a bit
annoying and it is only use for iterating, so use a sentinel to mark the end of
each array instead. Different fix for a problem pointed out by Kalle Olavi
Niemitalo.
2009-07-15 17:44:47 +00:00
Nicholas Marriott
ff500b46c9 For some reason when clearing status/message it was redrawing the entire client
not just the status line. Changing this also revealed the check for the status
line was incorrect when drawing the pane.
2009-07-15 17:44:06 +00:00
Nicholas Marriott
72d56bd614 Instead of faking up a status line in status_redraw, use the same code to
redraw it as to draw the entire screen, just skip all lines but the last.
2009-07-15 17:43:45 +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
9f0653386b $Id$. 2009-07-01 23:06:32 +00:00
Nicholas Marriott
de2ea2d178 Status line fixes: don't truncate status-right now the length calculation is
done for UTF-8, limit to the maximum length correctly when printing, and always
print a space even if the left string is longer than the width available.
2009-06-26 15:34:12 +00:00
Nicholas Marriott
bb459beb03 Whitespace and more syncing. 2009-06-25 16:34:50 +00:00
Nicholas Marriott
a5830b9603 Restore $Id$ and add script to do so. 2009-06-25 16:21:32 +00:00
Nicholas Marriott
418128bebc If the prompt is hidden or a password is sent with -U, zero it before freeing
it.
2009-06-25 15:55:34 +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
17a6c01d58 Don't show real character under cursor when hidden. Doh. 2009-05-29 05:40:56 +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
6805217783 Move dist.mk to tools/. 2009-05-17 18:15:41 +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
f1bd3807ae Everything supported has working vsnprintf. 2009-05-13 23:29:45 +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
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
Tiago Cunha
c80ad456cc Avoid using the prompt history when the server is locked, and prevent any
input entered from being added to the client's prompt history. From nicm.
2009-04-27 13:56:51 +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
03d531ebc6 Move sx,sy into tty rather than client. 2009-02-11 17:50:36 +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
Tiago Cunha
804beb9266 Support commands with right parenthesis. From nicm and me. 2009-02-01 18:14:49 +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
Tiago Cunha
2bb499c8af Support #(command) in status-left, and status-right. 2009-01-29 23:35:14 +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
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
2afa8ebc02 Fix various silly problems with status line off. 2009-01-19 20:14:55 +00:00
Nicholas Marriott
94471aab82 Use reverse rather than background which doesn't show up when terminal doesn't
support colours.
2009-01-19 19:01:11 +00:00
Nicholas Marriott
0e197b417a Tidy a few warnings. 2009-01-17 18:47:37 +00:00
Nicholas Marriott
5aa3098bb6 Support #S #H in status-left/right. 2009-01-15 23:42:21 +00:00
Nicholas Marriott
b4ac8c1342 Multiple window splitting. 2009-01-14 19:29:32 +00:00
Nicholas Marriott
7cd3cf0ead Make the window pane code handle panes of different sizes, and add a -l and -p arguments to split-window to specify the new window size in lines or as a percentage. 2009-01-12 18:22:47 +00:00