summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Use UTF-8 line drawing characters on UTF-8 terminals. Fixes some stupidnicm2010-09-111-37/+20
| | | | | | | | terminals (I'm looking at you, putty) which disable the vt100 ACS mode switching sequences in UTF-8 mode. Also on terminals without ACS at all, use ASCII equivalents where obvious.
* Change the way backoff works. Instead of stopping reading from the ptynicm2010-08-111-2/+4
| | | | | | | | | | when the client tty backs up too much, just stop updating the tty and only update the internal screen. Then when the tty recovers, force a redraw. This prevents a dodgy client from causing other clients to go into backoff while still allowing tmux to be responsive (locally) when seeing lots of output.
* Fix problems with window sizing seen by Raghavendra D Prabhu whennicm2010-06-051-9/+30
| | | | | | | | | | | | | | | | | | starting tmux from .xinitrc. One of the very few things the server relies on the client for now is to pass through a message on SIGWINCH, but there is a condition where potentially a SIGWINCH may be lost during the transition from unattached (main.c) to attached (client.c). So trigger a size change immediately after the client installs its SIGWINCH handler. Also, when the terminal is resized, reset the scroll region and cursor position. Previously, we were clearing our saved idea of these, but in fact some terminals do not reset them on resize, so this caused problems during redraw. While here make a resize to the same size not cause a redraw and rename the tmux.out output log file to include the tmux PID.
* Shut up gcc4 warnings.nicm2010-06-051-3/+3
|
* When the mode-mouse option is on, support dragging to make a selectionnicm2010-05-311-6/+13
| | | | | | | | in copy mode. Also support the scroll wheel, although xterm strangely does not ignore it in application mouse mode, causing redraw artifacts when scrolling up (other terminals appear to be better behaved).
* Check for colour and attribute modifications early so the translatednicm2010-03-011-53/+92
| | | | | | values can be stored in the cached terminal attributes rather than the requested (untranslated) values. Prevents tmux clearing and setting the attributes for every character when using aixterm colours.
* Don't set the terminal to nonblocking on detach until we have finished with itnicm2010-02-241-5/+4
| | | | entirely.
* If redrawing line 0 of the screen onto the tty, there can't be a wrap flag onnicm2010-02-011-2/+2
| | | | | the previous line, so move the cursor. Fixes status line redraw issues when resizing in choose mode and hopefully at other times as well.
* Use tcflush(3) instead of TIOCFLUSH, from Ed Schouten.nicm2010-01-011-6/+3
|
* Fix the logic so that transition from a 256 colour to default works properly.nicm2009-12-261-5/+7
|
* Nuke some stray debugging.nicm2009-12-261-2/+1
|
* Pass through the aixterm bright colours if the terminal supports them (>= 16nicm2009-12-141-1/+28
| | | | colours).
* vte is buggy and doesn't home the cursor after changing the scrollnicm2009-12-041-4/+2
| | | | region. Several people are hitting this, so add a workaround.
* Massive spaces->tabs and trailing whitespace cleanup, hopefully for the lastnicm2009-12-031-41/+41
| | | | | time now I've configured emacs to make them displayed in really annoying colours...
* Reflect the keypad mode of the application so that numlock works.nicm2009-12-021-2/+8
|
* Add a couple of comments.nicm2009-11-271-1/+2
|
* Fix type - attributes should be u_char not int.nicm2009-11-261-7/+6
|
* Remove a couple of unused arguments where possible, and add /* ARGSUSED */ tonicm2009-11-261-4/+6
| | | | the rest to reduce lint output.
* Emulate il1, dl1, ich1 to run (albeit slowly) with vt100 feature set.nicm2009-11-261-5/+9
|
* Cleanup by moving various (mostly horrible) little bits handling UTF-8 gridnicm2009-11-181-10/+6
| | | | | | | data into functions in a new file, grid-utf8.c, and use sizeof intead of UTF8_DATA. Also nuke trailing whitespace from tmux.1, reminded by jmc.
* Emulate the ri (reverse index) capability: this allows tmux to at least startnicm2009-11-121-2/+3
| | | | | | on Sun consoles (TERM=sun or sun-color), even if there appear to still be problems on some boxes (my Blade 100 is fine but edd's Blade 1000 shows odd screen corruption).
* Just ignore tty fd errors rather than dying, stops the server dying if thenicm2009-11-091-2/+1
| | | | session is disconnected abrubtly (eg ssh ~.).
* Clear to the end of the screen from the right starting point when drawingnicm2009-11-051-2/+2
| | | | | line-by-line (in panes or if ed not supported). Fixes problem spotted by Frank Terbeck.
* Switch tty key input over to happen on a read event. This is a bit morenicm2009-11-051-2/+13
| | | | | | | | | | complicated because of escape input, but in that case instead of processing a key immediately, schedule a timer and reprocess the bufer when it expires. This currently assumes that keys will be atomic (ie that if eg F1 is pressed the entire sequence is present in the buffer). This is usually but not always true, a change in the tree format so it can differentiate potential (partial) key sequences will happens soon and will allow this to be fixed.
* Switch tty fds over to a bufferevent.nicm2009-11-041-10/+22
|
* Ignore the colour on space, /not/ the attributes.nicm2009-11-041-5/+1
|
* Fix the reverse emulation when a terminal doesn't have setab to use the correctnicm2009-11-041-19/+25
| | | | fg/bg (adjusted if spaces) and happen before attribute setting.
* Add a minor optimisatin: if the character being printed is space, don't worrynicm2009-10-281-3/+17
| | | | about setting the background colour or attributes (except reverse).
* Twaek this slightly to avoid confusing use of flags variable.nicm2009-10-281-11/+10
|
* Setting SGR0 when setting the fg and bg has problems if only one of the two isnicm2009-10-281-88/+145
| | | | | | | | meant to be default, so rewrite the code to move this outside, move setting colours before attributes and generally clean up. Tested by sthen@, fixes problems he was seeing with mutt and should fix some existing problems with (rarely) lost attributes.
* tabs are better; ok nicmderaadt2009-10-261-2/+2
|
* Remove the -d flag to tmux and just use op/AX to detect default colours.nicm2009-10-251-15/+24
| | | | | | | | | | | | Irritatingly, although op can be used to tell if a terminal supports default colours, it can't be used to set them because in some terminfo descriptions it resets attributes as a side-effect (acts as sgr0) and in others it doesn't, so it is not possible to determine reliably what the terminal state will be afterwards. So if AX is missing and op is present, tmux just sends sgr0. Anyone using -d for a terminal who finds they actually needed it can replace it using terminal-overrides, but please let me know as it is probably an omission from terminfo.
* Unused variable.nicm2009-10-211-2/+2
|
* Now we are correctly not redrawing the whole pane on linefeed, redo thenicm2009-10-211-9/+16
| | | | last-cursor-position code to move to the right position when panes reach EOL.
* Don't redraw the scroll region on linefeed/reverse index unless it is necessarynicm2009-10-211-17/+19
| | | | | (the cursor is at the bottom/top). Should fix slow cursor movement when using vi in a pane spotted by pirofti@.
* Some terminals don't correctly clear their let's-wrap flag after changing thenicm2009-10-211-1/+10
| | | | | | | 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.
* Try to reduce the UTF-8 mess.nicm2009-10-201-4/+3
| | | | | | | | | | | | 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.
* UTF-8 combined character fixes.nicm2009-10-201-8/+7
| | | | | | | | | | 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.
* Move the check for whether to force a line wrapper lower down into the tty codenicm2009-10-201-1/+9
| | | | where it has access to the tty width, which is what should have been checked.
* Always move the cursor position on !xenl terminals, since there is no invisiblenicm2009-10-171-2/+3
| | | | | | last cursor position. Also nuke an unused variable.
* Instead of having a complicated check to see if the cursor is in the lastnicm2009-10-171-24/+12
| | | | | | position to avoid an explicit wrap, actually move it there. Some UTF-8 fixes to come.
* When checking whether the region will scroll and the cursor position is thusnicm2009-10-161-3/+3
| | | | | unsuitable for using CUD/CUU, check the current cursor position not the target position.
* Don't try to use \n across scroll region when doing \r\n either.nicm2009-10-131-2/+2
|
* Instead of using something sort of similar for both newline checks, usenicm2009-10-131-3/+4
| | | | something the same. Doesn't fix the bug I'm looking for though :-/.
* When drawing lines that have wrapped naturally, don't force a newline butnicm2009-10-121-6/+47
| | | | | | | | | | | | 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.
* Don't run through the column unchanged case if the row was unchanged but therenicm2009-10-121-5/+10
| | | | | were no suitable optimisations, instead make it an else to fall through to absolute addressing.
* If the vertical cursor movement crosses the scroll region, CUU and CUDnicm2009-10-121-7/+8
| | | | shouldn't be used even if VPA isn't present - in that case CUP should be used.
* Use absolute movement if right at the end of the line as it isn't a reliablenicm2009-10-121-3/+6
| | | | place to move from relatively.
* Use relative cursor movement instead of absolute when possible and whennicm2009-10-121-8/+115
| | | | | supported by the terminal to reduce the size of the output data (generally about 10-20%).
* Similarly add a tty_cursor_pane function to tidy up most of the calls.nicm2009-10-121-29/+39
|