aboutsummaryrefslogtreecommitdiff
path: root/tty.c
Commit message (Collapse)AuthorAge
...
* Sync OpenBSD patchset 432:Tiago Cunha2009-10-23
| | | | | Unused variable.
* Sync OpenBSD patchset 429:Tiago Cunha2009-10-23
| | | | | | 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.
* Sync OpenBSD patchset 427:Tiago Cunha2009-10-23
| | | | | | | 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@.
* Sync OpenBSD patchset 426:Tiago Cunha2009-10-23
| | | | | | | | | 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.
* Sync OpenBSD patchset 421:Tiago Cunha2009-10-23
| | | | | | | | | | | | | | | 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.
* Sync OpenBSD patchset 420:Tiago Cunha2009-10-23
| | | | | | | | | | | | | 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.
* Sync OpenBSD patchset 419:Tiago Cunha2009-10-23
| | | | | | 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.
* Sync OpenBSD patchset 416:Tiago Cunha2009-10-23
| | | | | | | | Always move the cursor position on !xenl terminals, since there is no invisible last cursor position. Also nuke an unused variable.
* Sync OpenBSD patchset 414:Tiago Cunha2009-10-23
| | | | | | | | 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.
* Sync OpenBSD patchset 413:Tiago Cunha2009-10-23
| | | | | | | 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.
* Sync OpenBSD patchset 404:Tiago Cunha2009-10-15
| | | | | Don't try to use \n across scroll region when doing \r\n either.
* Sync OpenBSD patchset 402:Tiago Cunha2009-10-15
| | | | | | 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 :-/.
* Sync OpenBSD patchset 401:Tiago Cunha2009-10-15
| | | | | | | | | | | | | | 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.
* Sync OpenBSD patchset 399:Tiago Cunha2009-10-15
| | | | | | | 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.
* Sync OpenBSD patchset 398:Tiago Cunha2009-10-15
| | | | | | 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.
* Sync OpenBSD patchset 396:Tiago Cunha2009-10-15
| | | | | | Use absolute movement if right at the end of the line as it isn't a reliable place to move from relatively.
* Sync OpenBSD patchset 395:Tiago Cunha2009-10-15
| | | | | | | Use relative cursor movement instead of absolute when possible and when supported by the terminal to reduce the size of the output data (generally about 10-20%).
* Sync OpenBSD patchset 393:Tiago Cunha2009-10-15
| | | | | Similarly add a tty_cursor_pane function to tidy up most of the calls.
* Sync OpenBSD patchset 392:Tiago Cunha2009-10-15
| | | | | _absolute is redundant, just use tty_region.
* Sync OpenBSD patchset 391:Tiago Cunha2009-10-15
| | | | | | Cleanup: use two functions for region setting, one for absolute and one inside pane.
* Sync OpenBSD patchset 390:Tiago Cunha2009-10-12
| | | | | | | | Like linefeed, don't set the scroll region for reverse index unless it will be needed. While here, also tidy up a couple of long lines and remove an extraneous blank.
* Sync OpenBSD patchset 372:Tiago Cunha2009-10-11
| | | | | | There is no point setting the scroll region up for line feeds unless scrolling is actually going to happen, so don't.
* Sync OpenBSD patchset 368:Tiago Cunha2009-10-09
| | | | | | The UTF-8 detection idea doesn't work and I am reasonably happy with the current methods, so remove the (already #ifdef 0'd) code.
* Sync OpenBSD patchset 366:Tiago Cunha2009-10-09
| | | | | | Be less aggressive about turning the cursor off, only explicitly turn it off when tmux is redrawing, otherwise leave in the state set by the application.
* Sync OpenBSD patchset 350:Tiago Cunha2009-09-23
| | | | | | | | | Support -c like sh(1) to execute a command, useful when tmux is a login shell. Suggested by halex@. This includes another protocol version increase (the last for now) so again restart the tmux server before upgrading.
* Sync OpenBSD patchset 348:Tiago Cunha2009-09-23
| | | | | | Don't die if the client is detaching (the tty has been closed) after waking up from locking.
* Sync OpenBSD patchset 347:Tiago Cunha2009-09-23
| | | | | | | | | | | | | | | | Remove the internal tmux locking and instead detach each client and run the command specified by a new option "lock-command" (by default "lock -np") in each client. This means each terminal has to be unlocked individually but simplifies the code and allows the system password to be used to unlock. Note that the set-password command is gone, so it will need to be removed from configuration files, and the -U command line flag has been removed. This is the third protocol version change so again it is best to stop the tmux server before upgrading.
* Sync OpenBSD patchset 346:Tiago Cunha2009-09-23
| | | | | | | | | Trim some code by moving the ioctl(TIOCGWINSZ) after SIGWINCH from the client into the server. This is another (the second of four) protocol version changes coming this morning, so again the server should be killed before upgrading.
* Sync OpenBSD patchset 345:Tiago Cunha2009-09-23
| | | | | | | | | | | Don't attempt to open() the tty path, rely on the client sending its stdin fd with imsg and fatal if it doesn't, then set the FD_CLOEXEC flag in tty_init instead of tty_open to prevent them leaking into child processes if any are created between the two calls. This bumps the protocol version, so the tmux server should be killed before upgrading.
* Sync OpenBSD patchset 344:Tiago Cunha2009-09-23
| | | | | | Be more careful about what flags are cleared when opening the terminal, otherwise the opened/started flags are cleared and the terminal never released.
* Sync OpenBSD patchset 322:Tiago Cunha2009-09-11
| | | | | | Permit options such as status-bg to be configured using the entire 256 colour palette by setting "colour0" to "colour255".
* Sync OpenBSD patchset 302:Tiago Cunha2009-08-31
| | | | | | | Add a new display-panes command, with two options (display-panes-colour and display-panes-time), which displays a visual indication of the number of each pane.
* Sync OpenBSD patchset 287:Tiago Cunha2009-08-21
| | | | | Emulate dch/dch1 if missing by redrawing the entire line.
* This is a better fix for OS X stupidity.Nicholas Marriott2009-08-19
|
* Sync OpenBSD patchset 262:Tiago Cunha2009-08-16
| | | | | | | Send SGR0 when initialising the screen. Fixes problems on terminals with BCE (like putty) if the background colours is non-default when tmux starts. May also fix problems when resuming a suspended tmux.
* Sync OpenBSD patchset 250:Tiago Cunha2009-08-14
| | | | | | | | | A tty context must not be modified as it may be reused to update multiple clients, so make it const. Also fix an actual modification which caused a hang when a session was connected to multiple terminals at least one of which was missing ich/ich1.
* Sync OpenBSD patchset 247:Tiago Cunha2009-08-14
| | | | | | | | Initialise log_fd to -1, prevents spurious disconnection of the client when it ends up as fd 0 (likely if the server is started with "tmux start"). Also add some extra debugging messages to server.c.
* Sync OpenBSD patchset 246:Tiago Cunha2009-08-14
| | | | | | | | | | | Have the client pass its stdin fd to the server when identifying itself and have the server use that rather than reopening the tty. If the fd isn't given, use the old behaviour (so no need for a version change). This allows tmux to be used as the shell, so also change so that when working out the command to execute if default-command is empty (the default), tmux will try not execute itself.
* Sync OpenBSD patchset 245:Tiago Cunha2009-08-14
| | | | | Add a TTY_OPENED flag and tidy a little.
* Sync OpenBSD patchset 244:Tiago Cunha2009-08-14
| | | | | | Drop the no_stop argument to tty_close and tty_free in favour of a flag in the tty struct.
* Sync OpenBSD patchset 226:Tiago Cunha2009-08-09
| | | | | | | | | | | | | | 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.
* Sync OpenBSD patchset 220:Tiago Cunha2009-08-09
| | | | | | | | | | 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.
* Sync OpenBSD patchset 211:Tiago Cunha2009-08-09
| | | | | | | | | | Add a terminal-overrides session option allowing individual terminfo(5) entries to be overridden. The 88col/256col checks are now moved into the default setting and out of the code. Also remove a couple of old workarounds for xterm and rxvt which are no longer necessary (tmux can emulate them if missing).
* Sync OpenBSD patchset 186:Tiago Cunha2009-07-28
| | | | | Draw UTF-8 characters under the selection correctly.
* Sync OpenBSD patchset 164:Tiago Cunha2009-07-23
| | | | | | tty_write is relatively short and the only function left in tty-write.c so move it into tty.c.
* Sync OpenBSD patchset 162:Tiago Cunha2009-07-23
| | | | | | More tty code tidying: move the saved cursor/region position (from before the screen was updated) out of struct screen and into struct tty_ctx.
* Sync OpenBSD patchset 160:Tiago Cunha2009-07-23
| | | | | | | enum tty_cmd is only used as an index into the array of command function pointers, so remove it and use the function pointers directly to represent themselves.
* Sync OpenBSD patchset 159:Tiago Cunha2009-07-22
| | | | | | There are relatively few arguments to tty_cmd_* functions now, so tidy them up by using a struct rather than hiding everything with varargs.
* Sync OpenBSD patchset 158:Tiago Cunha2009-07-22
| | | | | | tty_cmd_raw is only used once, for raw UTF-8 output, so rename it to tty_cmd_utf8character and eliminate the size argument.
* Don't send initialisation strings is1/2/3 (barely anything else does) and moveNicholas Marriott2009-07-12
| | | | | | smcup to the first and rmcup to the last sequences output to the terminal. This allows tmux to use the alternate screen (smcup/rmcup) when available.