Commit Graph

8444 Commits

Author SHA1 Message Date
Nicholas Marriott
fd35b6f836 Only redraw the pane when changing mode, not the entire window. 2009-10-22 12:30:00 +00:00
Nicholas Marriott
eb0c33cba4 Merge prepare_cmd into main as it is short and only called once. 2009-10-22 10:04:07 +00:00
Nicholas Marriott
284b94662a Tidy identify message send into a separate function. 2009-10-21 21:11:55 +00:00
Nicholas Marriott
d69b364b5f Don't try to unsuspend a client if it isn't suspended. 2009-10-21 20:16:40 +00:00
Nicholas Marriott
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
Nicholas Marriott
59e667906f Unused variable. 2009-10-21 19:27:09 +00:00
Nicholas Marriott
a22c06a2d6 Remove unused function. 2009-10-21 18:20:16 +00:00
Nicholas Marriott
9a4855295b Nuke dead store. 2009-10-21 18:12:31 +00:00
Nicholas Marriott
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
Nicholas Marriott
af2b0f452c Tweak descriptions for up/down pane to be clearer. 2009-10-21 13:48:27 +00:00
Nicholas Marriott
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
Nicholas Marriott
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
Nicholas Marriott
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
Nicholas Marriott
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
Nicholas Marriott
bb625a76d9 +. 2009-10-21 07:19:59 +00:00
Nicholas Marriott
9afb0d739e %zu not %u, doh. 2009-10-20 22:17:33 +00:00
Nicholas Marriott
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
Nicholas Marriott
480f5d3184 Correctly nuke the EOL $ marker when scrolling, reported by martynas@, thanks. 2009-10-20 21:35:25 +00:00
Nicholas Marriott
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
Nicholas Marriott
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
Nicholas Marriott
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
Nicholas Marriott
d1e6388fed Nuke stray blank line. 2009-10-20 14:22:57 +00:00
Nicholas Marriott
b027aa103c +. 2009-10-20 14:22:17 +00:00
Nicholas Marriott
2afe395ff2 Stop updating the screen when not in output mode, stops copy mode getting
confused.
2009-10-19 13:18:13 +00:00
Nicholas Marriott
59269a431b +. 2009-10-17 15:58:52 +00:00
Nicholas Marriott
daa26079ee Always move the cursor position on !xenl terminals, since there is no invisible
last cursor position.

Also nuke an unused variable.
2009-10-17 08:35:38 +00:00
Nicholas Marriott
fe26b5d25f Don't print wide characters at screen width - 1. Matches uterm behaviour and
is probably a better idea anyway.
2009-10-17 08:32:18 +00:00
Nicholas Marriott
43d62c1ae3 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-17 08:24:46 +00:00
Nicholas Marriott
70355021d8 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-16 19:09:40 +00:00
Nicholas Marriott
c8f2584d87 +. 2009-10-15 20:48:51 +00:00
Tiago Cunha
24d7cf6618 Sync OpenBSD patchset 412:
The pane pty name isn't useful for anything so show the pane number instead.
2009-10-15 20:10:28 +00:00
Nicholas Marriott
1fdf489cae Turn off stupid warnings when using Sun CC. 2009-10-15 08:15:06 +00:00
Nicholas Marriott
0614ca434a Fill in the tty name in SunOS's forkpty compat, and use it in osdep_getname.
From Todd Carson.

Tweaked by me to nuke (void) casts. Say no to lint appeasement! ;-)
2009-10-15 07:11:25 +00:00
Nicholas Marriott
dba0d54cf5 The pane pty name isn't useful for anything so show the pane number instead. 2009-10-15 07:05:38 +00:00
Tiago Cunha
8085adb8a2 Sync OpenBSD patchset 411:
cmd_find_client shouldn't die when there is an empty slot in the clients
array. DOH.
2009-10-15 01:56:45 +00:00
Tiago Cunha
3d88da7b2a Sync OpenBSD patchset 409:
Move lines into the history when scrolling even if the scroll region is not
the entire screen.

Allows ircII users to see history, prompted by naddy.
2009-10-15 01:55:12 +00:00
Tiago Cunha
ee46dba585 Sync OpenBSD patchset 408:
Handle DECCOLM by just emulating its side-effect of clearing the screen.
2009-10-15 01:53:48 +00:00
Tiago Cunha
a505ca69d9 Sync OpenBSD patchset 407:
Add mode keys to move the cursor to the top, middle and bottom of the screen.
H/M/L in vi mode and M-R/M-r in emacs (bottom of screen not bound in emacs).
2009-10-15 01:52:47 +00:00
Tiago Cunha
428f76db80 Fix CVS keyword. 2009-10-15 01:51:09 +00:00
Tiago Cunha
b6ebf7cb60 Update. 2009-10-15 01:49:39 +00:00
Tiago Cunha
6257be6371 Sync OpenBSD patchset 406:
Do this in a better way - print messages when exiting with nonzero.

Also remove the login shell information from server-info, only the client
should care about it.
2009-10-15 01:48:24 +00:00
Tiago Cunha
9800dc4697 Sync OpenBSD patchset 405:
Don't print exit messages when used as a login shell, requested by martynas@ a
while back.
2009-10-15 01:45:13 +00:00
Tiago Cunha
b8e4bd2029 Sync OpenBSD patchset 404:
Don't try to use \n across scroll region when doing \r\n either.
2009-10-15 01:44:15 +00:00
Tiago Cunha
941032b707 Sync OpenBSD patchset 403:
When a session is unattached, reset its activity timer to prevent it locking
instantly when reattached.
2009-10-15 01:43:16 +00:00
Tiago Cunha
fe99f6fa11 Sync OpenBSD patchset 402:
Instead of using something sort of similar for both newline checks, use
something the same. Doesn't fix the bug I'm looking for though :-/.
2009-10-15 01:42:07 +00:00
Tiago Cunha
6103628129 Sync OpenBSD patchset 401:
When drawing lines that have wrapped naturally, don't force a newline but
permit them to wrap naturally again. This allows terminals that use this to
guess where lines start and end for eg mouse selecting (like xterm) to work
correctly.

This was another long-standing issue raised by several people over the last
while.

Thanks to martynas@ for much testing. This was not trivial to get right so
bringing it in for wider testing and adn to fix any further glitches in-tree.
2009-10-15 01:41:14 +00:00
Tiago Cunha
cbd3b1bc9b Sync OpenBSD patchset 400:
When backspace is received at the beginning of a line and the previous line was
wrapped, move the cursor back up to the end of the previous line.

Another one of the forgotten persons requested this quite a while ago (I need
to start noting names on todo items...) when it was quite hard to
implement. Now it is easy and I don't see it can do any harm, so hey presto...
2009-10-15 01:39:30 +00:00
Tiago Cunha
04db3c6211 Sync OpenBSD patchset 399:
Don't run through the column unchanged case if the row was unchanged but there
were no suitable optimisations, instead make it an else to fall through to
absolute addressing.
2009-10-15 01:38:09 +00:00
Tiago Cunha
858b8b190b Sync OpenBSD patchset 398:
If the vertical cursor movement crosses the scroll region, CUU and CUD
shouldn't be used even if VPA isn't present - in that case CUP should be used.
2009-10-15 01:36:53 +00:00
Tiago Cunha
7af01a4afb Sync OpenBSD patchset 397:
Wrap a couple of long lines.
2009-10-15 01:35:35 +00:00