Commit Graph

5221 Commits

Author SHA1 Message Date
dbefea339f Sync OpenBSD patchset 436:
Merge prepare_cmd into main as it is short and only called once.
2009-10-23 17:40:23 +00:00
9260888d1c Fix CVS keyword. 2009-10-23 17:38:42 +00:00
eaa188bb63 Sync OpenBSD patchset 435:
Tidy identify message send into a separate function.
2009-10-23 17:37:41 +00:00
dc8b7d6b03 Sync OpenBSD patchset 434:
Don't try to unsuspend a client if it isn't suspended.
2009-10-23 17:33:26 +00:00
84392ffc0d Sync OpenBSD patchset 433:
Client tidying: get rid of client_ctx struct in favour of two variables in
client.c, and move the functions in client-fn.c into other files.
2009-10-23 17:32:26 +00:00
c6828bf32b Sync OpenBSD patchset 432:
Unused variable.
2009-10-23 17:28:29 +00:00
31552722a8 Sync OpenBSD patchset 431:
Remove unused function.
2009-10-23 17:27:40 +00:00
d7d4d7830b Sync OpenBSD patchset 430:
Nuke dead store.
2009-10-23 17:26:40 +00:00
dbf2351d3a Sync OpenBSD patchset 429:
Now we are correctly not redrawing the whole pane on linefeed, redo the
last-cursor-position code to move to the right position when panes reach EOL.
2009-10-23 17:25:51 +00:00
9731625230 Sync OpenBSD patchset 428:
Tweak descriptions for up/down pane to be clearer.
2009-10-23 17:24:57 +00:00
a572533c89 Sync OpenBSD patchset 427:
Don't redraw the scroll region on linefeed/reverse index unless it is necessary
(the cursor is at the bottom/top). Should fix slow cursor movement when using
vi in a pane spotted by pirofti@.
2009-10-23 17:23:52 +00:00
8ec8d1f32a Sync OpenBSD patchset 426:
Some terminals don't correctly clear their let's-wrap flag after changing the
scroll region (which moves the cursor to 0,0). This means that if the cursor
was at the edge of the screen, any further output after scroll region change
incorrectly causes a line wrap. Add a workaround to move the cursor to position
0 if it is at the screen edge before changing scroll region.
2009-10-23 17:22:39 +00:00
21b23f8e54 Sync OpenBSD patchset 424:
%zu not %u, doh.
2009-10-23 17:21:34 +00:00
fce889235c Sync OpenBSD patchset 422:
Correctly nuke the EOL $ marker when scrolling, reported by martynas@, thanks.
2009-10-23 17:17:20 +00:00
f41a3914a5 Sync OpenBSD patchset 421:
Try to reduce the UTF-8 mess.

Get rid of passing around u_char[4]s and define a struct utf8_data which has
character data, size (sequence length) and width. Move UTF-8 character
collection into two functions utf8_open/utf8_append in utf8.c which fill in
this struct and use these functions from input.c and the various functions in
screen-write.c.

Space for rather more data than is necessary for one UTF-8 sequence is in the
utf8_data struct because screen_write_copy is still nasty and needs to reinject
the character (after combining) into screen_write_cell.
2009-10-23 17:16:25 +00:00
c643ac4827 Sync OpenBSD patchset 420:
UTF-8 combined character fixes.

Thai can have treble combinations (1 x width=1 then 2 x width=0) so bump the
UTF-8 cell data size to 9 and alter the code to allow this.

Also break off the combining code into a separate function, handle any further
combining beyond the buffer size by replacing the character with _s, and when
redrawing the UTF-8 character don't assume the first part has just been
printed, redraw the entire line.
2009-10-23 17:13:10 +00:00
97e02eae7d Sync OpenBSD patchset 419:
Move the check for whether to force a line wrapper lower down into the tty code
where it has access to the tty width, which is what should have been checked.
2009-10-23 17:11:26 +00:00
516bfe7ba3 Sync OpenBSD patchset 418:
Nuke stray blank line.
2009-10-23 17:10:00 +00:00
9463492ac1 Sync OpenBSD patchset 417:
Stop updating the screen when not in output mode, stops copy mode getting
confused.
2009-10-23 17:09:21 +00:00
2f14ef61ff Sync OpenBSD patchset 416:
Always move the cursor position on !xenl terminals, since there is no invisible
last cursor position.

Also nuke an unused variable.
2009-10-23 17:08:30 +00:00
2e39ab59d7 Sync OpenBSD patchset 415:
Don't print wide characters at screen width - 1. Matches uterm behaviour and
is probably a better idea anyway.
2009-10-23 17:07:18 +00:00
ac4e4a2b6c Sync OpenBSD patchset 414:
Instead of having a complicated check to see if the cursor is in the last
position to avoid an explicit wrap, actually move it there.

Some UTF-8 fixes to come.
2009-10-23 17:06:23 +00:00
13d1df659f Sync OpenBSD patchset 413:
When checking whether the region will scroll and the cursor position is thus
unsuitable for using CUD/CUU, check the current cursor position not the target
position.
2009-10-23 17:03:48 +00:00
c2b8f3b55a Support the bright fg/bg colour SGR 90-97 and 100-107.
Reported by Tim Allen.
2009-10-23 15:48:39 +00:00
1f22a199fb Redraw checks have to after handling input or pane redraw flags set by key
presses will not be acted on.
2009-10-22 21:01:52 +00:00
9c40a4edc5 The client buffers have to be checked after every event in order to catch the
escape timers and properly reset the cursor.
2009-10-22 20:04:21 +00:00
eddcc3dfa9 Split the server code handling clients, jobs and windows off into separate
files from server.c (merging server-msg.c into the client file) and rather than
iterating over each set after poll(), allow a callback to be specified when the
fd is added and just walk once over the returned pollfds calling each callback
where needed.

More to come, getting this in so it is tested.
2009-10-22 19:41:51 +00:00
fd35b6f836 Only redraw the pane when changing mode, not the entire window. 2009-10-22 12:30:00 +00:00
eb0c33cba4 Merge prepare_cmd into main as it is short and only called once. 2009-10-22 10:04:07 +00:00
284b94662a Tidy identify message send into a separate function. 2009-10-21 21:11:55 +00:00
d69b364b5f Don't try to unsuspend a client if it isn't suspended. 2009-10-21 20:16:40 +00:00
90ad041fa5 Client tidying: get rid of client_ctx struct in favour of two variables in
client.c, and move the functions in client-fn.c into other files.
2009-10-21 20:11:47 +00:00
59e667906f Unused variable. 2009-10-21 19:27:09 +00:00
a22c06a2d6 Remove unused function. 2009-10-21 18:20:16 +00:00
9a4855295b Nuke dead store. 2009-10-21 18:12:31 +00:00
dd46f634fe Now we are correctly not redrawing the whole pane on linefeed, redo the
last-cursor-position code to move to the right position when panes reach EOL.
2009-10-21 16:52:30 +00:00
af2b0f452c Tweak descriptions for up/down pane to be clearer. 2009-10-21 13:48:27 +00:00
9b5da97e6f Don't redraw the scroll region on linefeed/reverse index unless it is necessary
(the cursor is at the bottom/top). Should fix slow cursor movement when using
vi in a pane spotted by pirofti@.
2009-10-21 13:42:44 +00:00
683ddbc466 Some terminals don't correctly clear their let's-wrap flag after changing the
scroll region (which moves the cursor to 0,0). This means that if the cursor
was at the edge of the screen, any further output after scroll region change
incorrectly causes a line wrap. Add a workaround to move the cursor to position
0 if it is at the screen edge before changing scroll region.
2009-10-21 09:36:53 +00:00
4afecbe400 Getting the read and write ends of the pipe the right way round is usually
recommended. DOH.
2009-10-21 07:37:11 +00:00
7825871d6a Getting the read and write ends of the pipe the right way round is usually
recommended. DOH.
2009-10-21 07:24:23 +00:00
bb625a76d9 +. 2009-10-21 07:19:59 +00:00
9afb0d739e %zu not %u, doh. 2009-10-20 22:17:33 +00:00
6f2169037e Sort out stdout before stdin/stderr in case the stdout side of the pipe got one
of their fds.
2009-10-20 22:15:32 +00:00
480f5d3184 Correctly nuke the EOL $ marker when scrolling, reported by martynas@, thanks. 2009-10-20 21:35:25 +00:00
1af09d6330 Try to reduce the UTF-8 mess.
Get rid of passing around u_char[4]s and define a struct utf8_data which has
character data, size (sequence length) and width. Move UTF-8 character
collection into two functions utf8_open/utf8_append in utf8.c which fill in
this struct and use these functions from input.c and the various functions in
screen-write.c.

Space for rather more data than is necessary for one UTF-8 sequence is in the
utf8_data struct because screen_write_copy is still nasty and needs to reinject
the character (after combining) into screen_write_cell.
2009-10-20 19:18:28 +00:00
62f234ce3b UTF-8 combined character fixes.
Thai can have treble combinations (1 x width=1 then 2 x width=0) so bump the
UTF-8 cell data size to 9 and alter the code to allow this.

Also break off the combining code into a separate function, handle any further
combining beyond the buffer size by replacing the character with _s, and when
redrawing the UTF-8 character don't assume the first part has just been
printed, redraw the entire line.
2009-10-20 17:33:33 +00:00
387f4d42cc Move the check for whether to force a line wrapper lower down into the tty code
where it has access to the tty width, which is what should have been checked.
2009-10-20 16:32:23 +00:00
d1e6388fed Nuke stray blank line. 2009-10-20 14:22:57 +00:00
b027aa103c +. 2009-10-20 14:22:17 +00:00