aboutsummaryrefslogtreecommitdiff
path: root/screen-write.c
Commit message (Collapse)AuthorAge
...
* When clearing the entire screen, clear lines that are used into theNicholas Marriott2011-01-25
| | | | history like xterm does. Requested ages ago by someone I've forgotten.
* Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262Nicholas Marriott2011-01-03
| | | | | | | | | | and supports larger terminals than the older way. If the new mouse-utf8 option is on, UTF-8 mouse input is enabled for all UTF-8 terminals. The option defaults to on if LANG etc are set in the same manner as the utf8 option. With help and based on code from hsim at gmx.li.
* Support all four of the xterm mouse modes. Based on a diff from hsim atNicholas Marriott2010-12-29
| | | | gmx.li.
* Ensure we overwrite UTF-8 wide characters properly, and never overwriteNicholas Marriott2010-06-21
| | | | | characters we weren't overlapping. Fixes "disappearing wide characters" glitch. From Micah Cowan.
* Merge copy mode and output mode, dropping the latter. Idea and code fromNicholas Marriott2010-04-06
| | | | Micah Cowan.
* Massive spaces->tabs and trailing whitespace cleanup, hopefully for the lastNicholas Marriott2009-12-03
| | | | | time now I've configured emacs to make them displayed in really annoying colours...
* Remove a couple of unused arguments where possible, and add /* ARGSUSED */ toNicholas Marriott2009-11-26
| | | | the rest to reduce lint output.
* Cleanup by moving various (mostly horrible) little bits handling UTF-8 gridNicholas Marriott2009-11-18
| | | | | | | 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.
* A screen can be one cell wide; don't crash if that is the case.Nicholas Marriott2009-11-16
|
* Add an explicit zero-length check for UTF-8 input data, prompted by a reportNicholas Marriott2009-11-11
| | | | | | | | from parfait via deraadt. While here, add a statement to set the width when filling with _s if not enough space (width should never be high enough at the moment anyway), and wrap some long lines.
* Try to reduce the UTF-8 mess.Nicholas Marriott2009-10-20
| | | | | | | | | | | | 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.Nicholas Marriott2009-10-20
| | | | | | | | | | 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 codeNicholas Marriott2009-10-20
| | | | 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 invisibleNicholas Marriott2009-10-17
| | | | | | last cursor position. Also nuke an unused variable.
* Don't print wide characters at screen width - 1. Matches uterm behaviour andNicholas Marriott2009-10-17
| | | | is probably a better idea anyway.
* Instead of having a complicated check to see if the cursor is in the lastNicholas Marriott2009-10-17
| | | | | | position to avoid an explicit wrap, actually move it there. Some UTF-8 fixes to come.
* When drawing lines that have wrapped naturally, don't force a newline butNicholas Marriott2009-10-12
| | | | | | | | | | | | 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.
* When backspace is received at the beginning of a line and the previous line wasNicholas Marriott2009-10-12
| | | | | | | | 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...
* Wrap a couple of long lines.Nicholas Marriott2009-10-12
|
* Permit attributes to be turned off in #[] by prefixing with "no", for exampleNicholas Marriott2009-10-12
| | | | "noblink".
* Stick line length to what is actually used (removing an optimization thatNicholas Marriott2009-09-15
| | | | | | | | allowed it to be bigger), and use clear line/EOL sequences rather than spaces in copy/scroll mode. This fixes xterm copy/paste from tmux which treats trailing spaces differently from clearing a line with the escape sequences. Reported by martynas@.
* Permit options such as status-bg to be configured using the entire 256 colourNicholas Marriott2009-09-10
| | | | palette by setting "colour0" to "colour255".
* Permit embedded colour and attributes in status-left and status-right using newNicholas Marriott2009-09-07
| | | | #[] special characters, for example #[fg=red,bg=blue,blink].
* Ugh, committed the wrong version of this change and got both solutions ratherNicholas Marriott2009-08-21
| | | | than just the second. Remove unused assignment.
* A few trivial optimisations: no need to check for zero size if callingNicholas Marriott2009-08-20
| | | | | | buffer_ensure in buffer.c; expand grid lines by a greater increase than one each time; and don't read UTF-8 data unless it actually needs to be checked when overwriting a cell.
* It was originally intended that scroll mode would show content that wasNicholas Marriott2009-08-13
| | | | | | | currently off-screen due to resize, but somewhere along the way this got lost. Restore this behaviour to scroll mode by fixing screen_write_copy to read up to the saved line length rather than the current screen width. Copy mode remains unaltered for now.
* Add a flags member to the grid_line struct and use it to differentiate linesNicholas Marriott2009-08-08
| | | | | wrapped at the screen edge from those terminated by a newline. Then use this when copying to combine wrapped lines together into one.
* Plug some memory leaks.Nicholas Marriott2009-07-30
|
* Draw UTF-8 characters under the selection correctly.Nicholas Marriott2009-07-27
|
* More tty code tidying: move the saved cursor/region position (from before theNicholas Marriott2009-07-22
| | | | screen was updated) out of struct screen and into struct tty_ctx.
* enum tty_cmd is only used as an index into the array of command functionNicholas Marriott2009-07-22
| | | | | pointers, so remove it and use the function pointers directly to represent themselves.
* There are relatively few arguments to tty_cmd_* functions now, so tidy them upNicholas Marriott2009-07-22
| | | | by using a struct rather than hiding everything with varargs.
* tty_cmd_raw is only used once, for raw UTF-8 output, so rename it toNicholas Marriott2009-07-22
| | | | tty_cmd_utf8character and eliminate the size argument.
* The scroll region cannot be one line only, ignore attempts to make it so.Nicholas Marriott2009-07-14
|
* Cursor up and down should be limited by the scroll region (cuu should stop atNicholas Marriott2009-07-09
| | | | | the scroll region top if starting from below it and cud stop at the bottom if starting from above). Fixes another vttest test.
* Change inserting and deleting lines inside the scroll region to properly clearNicholas Marriott2009-07-09
| | | | | lines that should be inserted/deleted but not moved. Fixes problems with mutt reported by Brian Lewis, thanks.
* Tidy by removing unused argument from grid_view_{insert,delete}_line_regionNicholas Marriott2009-07-09
| | | | functions (currently don't fully work, this is to make fix easier).
* Fix two errors with character/line insertion and deletion: the maximum numberNicholas Marriott2009-06-29
| | | | | | | | | | of characters which may be inserted or deleted is the screen width, not one less (and similarly for lines and height); and if characters or lines are deleted by moving the ones that follow, the space at the end needs to be cleared. This appears to solve long-standing redraw issues most visible when using the force-width option then scrolling in view(1) or unwrapping lines in emacs.
* Status line fixes: don't truncate status-right now the length calculation isNicholas Marriott2009-06-26
| | | | | 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.
* Remove trailing newlines, spaces, and tabs.Ray Lai2009-06-05
| | | | No binary change.
* Support insert mode by using insert character to shift the cells before writingNicholas Marriott2009-06-03
| | | | as normal.
* Implement the DEC alignment test. With the last change this is enough for theNicholas Marriott2009-06-03
| | | | | first cursor test in vttest (in ports) to pass; it still shops a few more problems though.
* Fix some miscalculations when clearing to start of screen: the number of linesNicholas Marriott2009-06-03
| | | | to the cursor is cy not cy - 1, and the current cursor cell should be included.
* New session option, status-utf8, to control the interpretation of top-bit-setNicholas Marriott2009-06-03
| | | | | characters in status-left and status-right (if on, they are treated as UTF-8; otherwise passed through).
* Add a UTF-8 aware string length function and make UTF-8 inNicholas Marriott2009-06-03
| | | | | | 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.
* Import tmux, a terminal multiplexor allowing (among other things) a singleNicholas Marriott2009-06-01
terminal to be switched between several different windows and programs displayed on one terminal be detached from one terminal and moved to another. ok deraadt pirofti