aboutsummaryrefslogtreecommitdiff
path: root/csi.c (follow)
Commit message (Collapse)AuthorAgeLines
* csi: only respond to Primary DA when Ps == 0Daniel Eklöf2020-10-11-0/+5
|
* csi: avoid using memcmp() to compare timespec structsCraig Barnes2020-08-23-3/+9
| | | | | | | | | | | | | | | This struct may contain padding bytes, whose values are indeterminate after any store operation[1]. It may also contain unnamed members, whose values are always indeterminate[2]. Using memcmp() isn't a reliable way to compare structs where either of these may be present. [1]: ISO/IEC 9899:1999 §6.2.6.1, paragraph 6 [2]: ISO/IEC 9899:1999 §6.7.8, paragraph 9 See also: * https://wiki.sei.cmu.edu/confluence/display/c/EXP42-C.+Do+not+compare+padding+data * https://sourceware.org/git/?p=glibc.git;a=blob;f=time/bits/types/struct_timespec.h;hb=756c306502498f9
* csi: add 2 missing "break" statements in csi_dispatch()Craig Barnes2020-08-18-2/+2
|
* csi: xtrestore: add 'default' caseDaniel Eklöf2020-08-18-0/+2
| | | | | Don't call decset_decrst() with an unhandled parameter (and with 'enabled' uninitialized!)
* csi: xtrestore: add missing breakDaniel Eklöf2020-08-18-1/+1
|
* csi: xtsave/xtrestore: implement \E[?12s and \E[?12rDaniel Eklöf2020-08-18-2/+18
| | | | I.e. save/restore cursor-blink state.
* csi: decset/decrst: only clear mouse tracking/reporting if mode matchesDaniel Eklöf2020-08-18-9/+24
| | | | | | | | E.g. only set mouse reporting to NONE, if mouse reporting mode is SGR and an DECRST SGR is issued. Do *not* reset the mouse mode if e.g. mouse reporting mode is SGR and an DECRST URXVT is issued.
* csi: implement XTRESTOREDaniel Eklöf2020-08-16-16/+34
|
* csi: xtsave: store modes' SET state, not the current stateDaniel Eklöf2020-08-16-11/+11
|
* csi: implement CSI ? Pm s - XTSAVEDaniel Eklöf2020-08-16-16/+2
|
* csi: add xtsave()Daniel Eklöf2020-08-16-0/+31
| | | | This function stores the current state of DECSET private modes.
* csi: decrst: spell decset correctlyDaniel Eklöf2020-08-16-1/+1
|
* csi: add DEC names to a couple of DECSET modesDaniel Eklöf2020-08-16-1/+6
|
* csi: break out decset/decrstDaniel Eklöf2020-08-16-274/+206
|
* Fix some spelling mistakesCraig Barnes2020-08-15-3/+3
|
* Convert most dynamic allocations to use functions from xmalloc.hCraig Barnes2020-08-08-1/+2
|
* fix printf-format errors in 32-bit buildsDaniel Eklöf2020-08-06-1/+1
|
* term: remove unusued 'damage' listDaniel Eklöf2020-08-04-2/+0
|
* csi: secondary DA: do not pretend we're xtermDaniel Eklöf2020-07-24-2/+16
| | | | | | | | | | | Previously, our secondary DA response indicated a) VT420, b) an XTerm version number. Now, we indicate VT220 (which corresponds to the primary DA response), and we report foot's version number as MMmmpp. I.e major, minor and patch versions, using two digits. E.g. 1.4.2 is encoded as 010402
* csi: primary DA: remove features we do not supportDaniel Eklöf2020-07-24-1/+10
| | | | | | | | We do not implement * Selective Erase * Technical Character Set * Terminal state interrogation
* csi: never call term_print() with width <= 0Daniel Eklöf2020-07-16-2/+4
|
* csi: DECAWM: clear LCFDaniel Eklöf2020-07-14-0/+4
|
* csi: IND+RI now clears LCFDaniel Eklöf2020-07-14-0/+2
|
* term: rename term_formfeed() -> term_carriage_return()Daniel Eklöf2020-07-14-0/+3
|
* csi: '\E[0 q' resets the cursor style to the default, not '\E[2 q'Daniel Eklöf2020-06-30-6/+11
| | | | Also update 'Se' capability in the terminfo, to reflect this.
* csi: debug: print 'private' *after* parametersDaniel Eklöf2020-06-30-6/+6
|
* csi: \E[3J: reset render.last_cursor.row if necessaryDaniel Eklöf2020-06-09-0/+3
| | | | | This fixes a crash that occurred when the last rendered cursor cell had scrolled off screen, and \E[3J (clear scrollback) was executed.
* term: scrolling: calling function must clamp scroll amountDaniel Eklöf2020-05-19-4/+12
|
* csi: ignore invalid parameters in 'CSI Ps <space> q'Daniel Eklöf2020-05-04-4/+10
| | | | | Before this patch, an invalid parameter would not change the cursor style, but could cause the cursor to start (or stop) blinking.
* util.h: new header file defining commonly used macrosDaniel Eklöf2020-05-01-2/+1
|
* csi: log 'unhandled' for invalid 'target' and 'operation' in CSI ? SDaniel Eklöf2020-04-25-0/+7
|
* csi: fix typo - the '(' was in the wrong placeDaniel Eklöf2020-04-19-1/+1
|
* csi: CSI Ps ; Ps ; Ps t: report logical pixelsDaniel Eklöf2020-04-18-5/+8
|
* csi: implement CSI Ps ; Ps ; Ps t reporting escape sequencesDaniel Eklöf2020-04-18-10/+93
| | | | | | | | | | | | | | | | | | | | | | A lot of the escape sequences on the "CSI Ps ; Ps ; Ps t" form are expected to return a reply. Thus, not having these implemented means we will hang if the client sends these escapes. Not all of these escapes can be meaningfully implemented on Wayland, and thus this implementation is best effort. We now support the following escapes: * 11t - report if window is iconified (always replies "no") * 13t - report window position (always replies 0,0) * 13;2t - report text area position (replies with margins, since we cannot get the window's position) * 14t - report text area size, in pixels * 14;2t - report window size, in pixels * 15t - report screen size, in pixels * 16t - report cell size, in pixels * 18t - report text area size, in cells * 19t - report screen size, in cells
* grid: move 'cursor' state from terminal to gridDaniel Eklöf2020-04-16-61/+67
| | | | | This way, the 'normal' and 'alt' grids have their own cursor state, and we don't need to switch between them.
* Fix clang warningsDaniel Eklöf2020-04-12-1/+1
| | | | | | | | All are printf() formatter related. Even if a variable is e.g. a 'short', when used in an expression like '<variable> - 1' it is promoted to an 'int'. Closes #16
* alt-screen: use a custom 'saved' cursor when switching to alt screenDaniel Eklöf2020-03-16-3/+3
| | | | | | | | | | | | | This fixes an issue where we failed to restore the cursor correctly when exiting from the alternate screen, if the client had sent escapes to save the cursor position while inside the alternate screen. This was because we used the *same* storage for saving the cursor position through escapes, as for saving it when entering the alternate screen. Fix by using a custom variable dedicated to normal <--> alt screen switching.
* sixel: improve handling of images when reflowing the gridsDaniel Eklöf2020-03-13-5/+3
| | | | | | | | | | | Update the sixels' 'row' attribute when re-flowing a grid, to ensure it is rendered at the correct place. This should work in most cases, but will break when the cell size has changed (e.g. font size increase/decrease, or a DPI change). This patch also moves the sixel image list from the terminal struct into the grid struct. The sixels are per-grid after all.
* term: resize: pre-calculate right/bottom marginsDaniel Eklöf2020-02-24-11/+2
|
* csi: delete all sixels on the 'alt' grid when switching back to 'normal'Daniel Eklöf2020-02-22-0/+8
|
* sixel: application configurable image max width/heightDaniel Eklöf2020-02-22-4/+6
|
* sixel: application configurable palette size (color count)Daniel Eklöf2020-02-22-0/+25
| | | | | This implements the CSI escapes for retrieving and (re)setting the palette size.
* csi: DA: we now implement sixelDaniel Eklöf2020-02-22-1/+1
|
* csi: log only the un-handled parameter in a multi-operation CSIDaniel Eklöf2020-02-01-21/+24
| | | | | | Assume we don't handle 'CSI 4 X'. Furthermore, assume we receive the following: 'CSI 1;2;3;4X'. In this case, only log '4X' as un-handled, not the entire CSI string.
* csi: implement window and cell size reporting escapesDaniel Eklöf2020-02-01-1/+57
| | | | | | | | | | This implements the following queries: * report window size in pixels * report cell size in pixels * report window size in chars We also log a warning for the remaining window operation queries.
* csi: recognize the X10 mouse tracking enabler/disablerDaniel Eklöf2020-02-01-0/+6
| | | | | We still don't implement it, but now we at least recognize it and log a warning when it is implemented.
* csi: drop '28' from our DA responseDaniel Eklöf2020-02-01-1/+1
| | | | We don't support rectangular editing
* vt: use 8-bit indices for parameters and sub parametersDaniel Eklöf2020-02-01-3/+3
| | | | | We only support 16 (sub) parameters and thus there's no need for 64-bit index variables.
* csi: disable save/restore highlight mouse trackingDaniel Eklöf2020-01-23-0/+4
| | | | | We don't implement it, so no point in warning about save/restore not begin implemented.
* csi: warn when client tries to enable "highlight mouse tracking"Daniel Eklöf2020-01-23-0/+8
|
* input: implement metaSendsEscape and eightBitMetaDaniel Eklöf2020-01-20-3/+18
|
* csi: implement REP - CSI Ps bDaniel Eklöf2020-01-20-0/+16
|
* csi: change DA3 reply to "FOOT", in hexDaniel Eklöf2019-12-21-1/+1
|
* term: implement cursor blinkingDaniel Eklöf2019-12-15-5/+6
| | | | | | | | | | | | | | Blinking can be enabled either by setting the cursor style with CSI Ps SP q and selecting a blinking style. Or, with 'CSI ? 12 h' Note that both affect the same internal state. I.e. you can disable blinking with CSI ? 12l after having selected a blinking cursor style. This is consistent with XTerm behavior.
* csi: describe format of reply to tertiary DADaniel Eklöf2019-12-14-4/+10
|
* csi: Send Device Attributes, Tertiary DA: require Ps == 0Daniel Eklöf2019-12-14-4/+7
|
* csi/vt: don't bad client data as errorsDaniel Eklöf2019-11-29-1/+1
| | | | This gets rid of spam when cat:ing binary data.
* csi/ocs/vt: log unhandled/unrecognized sequences as debug messagesDaniel Eklöf2019-11-29-2/+2
| | | | | | | | Having them as error messages was nice when we where still missing lots of sequences. Now we don't anymore, and these just spam stdout as well as syslog when e.g. cat:ing binary data.
* terminal: use the 'text' xcursor pointer whenever selection is possibleDaniel Eklöf2019-11-28-0/+4
|
* csi: implement "Send Device Attributes (Tertiary DA)"Daniel Eklöf2019-11-18-0/+18
|
* csi: adjust reply to primary DADaniel Eklöf2019-11-18-1/+1
| | | | | | | | | | Report us as being VT220, as VT420 causes vttest to send a DECRQSS. This is a DCS request that we don't implement (there's no DCS handling *at all* - all DCS strings are ignored). Should be ok as no one appears to care about this one. Other terminals report a much lower level (urxvt for example, replies with vt100. We used to reply with vt102, which also was fine).
* csi: improve "Send Device Attributes (Primary DA)"Daniel Eklöf2019-11-18-2/+32
| | | | | | | Pretend we're a VT420, with a couple of supported features indicated. Note that I haven't verified we support *everything* that each features entails - or even what exactly a feature *is* (locator port?)
* csi: document "Send Device Attributes (Secondary DA)"Daniel Eklöf2019-11-18-0/+20
|
* csi: implement 'Query Device Status'Daniel Eklöf2019-11-18-0/+5
| | | | By replying with "Device OK"
* csi: add debug logs for the various mouse reporting modesDaniel Eklöf2019-11-18-1/+4
|
* term: try to improve on a performance regressionDaniel Eklöf2019-11-17-11/+9
| | | | | | | | When support was added for DECOM (absolute/relative row addressing), a small but noticeable (~3.5%) performance regression was introduced. Try to improve the situation by simplifying the relative-to-absolute conversion; only the row needs to be transformed.
* csi: implement 'CHT' - Cursor Horizontal TabDaniel Eklöf2019-11-17-0/+16
|
* csi: implement 'CPL' - Cursor Previous LineDaniel Eklöf2019-11-17-0/+6
|
* csi: implement 'CNL' - Cursor Next LineDaniel Eklöf2019-11-17-0/+6
|
* csi: implement 'HPR' - Horizontal Position RelativeDaniel Eklöf2019-11-17-0/+1
|
* csi: fix bad implementation of CBT (back tab)Daniel Eklöf2019-11-17-6/+13
| | | | | | | * It takes a parameter, that indicates the number of tab stops to move through * Use the tab stops defined in the tab stops list, not hard coded mod 8 columns.
* csi: implement 'HPA' - Horizontal Position AbsoluteDaniel Eklöf2019-11-17-0/+1
|
* term: move lcf flag into 'cursor' structDaniel Eklöf2019-11-17-9/+9
|
* term: add struct cursorDaniel Eklöf2019-11-17-42/+42
|
* term: rename: print_needs_wrap -> lcf (Last Column Flag)Daniel Eklöf2019-11-17-9/+9
|
* csi: el/ed/dch/ich/ech: reset 'print_needs_wrap' (lcf)Daniel Eklöf2019-11-17-0/+9
| | | | | This makes the result of 'wraptest', by Mattias Engdegård, match the behavior of 'DEC' (the architectural behavior of DEC terminals).
* csi: implement CSI 0g and CSI 3gDaniel Eklöf2019-11-16-0/+26
| | | | | * 0g - clear tab stop at current column * 3g - clear all tab stops
* csi: CSI ?4h enables smooth scrolling, ?4l enables jump scrollingDaniel Eklöf2019-11-05-2/+7
|
* csi: implement DECOM - switch cursor origin between absolute and relativeDaniel Eklöf2019-11-05-13/+27
| | | | | | | | | | | The default is absolute mode, where 0,0 is the upper left corner of the screen. In relative mode, the origin is relative the top scroll margin. Internally, we always track the current cursor position in absolute mode. Every time we the client *sets* or *queries* the cursor position in relative mode, we translate it to absolute.
* csi: DECCOLM erases screenDaniel Eklöf2019-11-05-0/+15
|
* csi: CSI ?3h enables 132 column mode, CSI ?3l 80 column modeDaniel Eklöf2019-11-05-2/+6
|
* csi: implement force cursor positionDaniel Eklöf2019-11-05-0/+1
|
* scan-build: fix a couple of minor warnings from a scan-build runDaniel Eklöf2019-11-05-2/+2
|
* csi: comment out handling of CSI ? 1042/1043 h/lDaniel Eklöf2019-11-04-0/+4
| | | | | In Wayland, we neither _have_ an urgency hint to set, nor can we raise the window(?)
* csi: recognize CSI ? 1042/1043 h/lDaniel Eklöf2019-11-04-0/+16
| | | | | 1042: set 'urgency' window manager hint when receiving ctrl-g 1043: raise window when receiving ctrl-g
* Rename: vt_to_slave() -> term_to_slave()Daniel Eklöf2019-11-02-4/+4
|
* csi: ignore invalid scrolling regions0.9.0Daniel Eklöf2019-09-29-7/+10
| | | | | | | | | | There must be at least one scrolling row. I.e. the bottom margin must be larger than the top margin. Note that trying to set an invalid region really will be *ignored*. I.e. we *don't* reset the scrolling region. This conforms to xterm's behavior.
* csi: don't ignore the color space identifier in SGRsDaniel Eklöf2019-09-04-10/+73
| | | | | | | | | Only a color space ID of '2' means the sequence is an RGB sequence. Update existing code to verify this, and ignore sequences with other color space IDs. Except color space ID '5', which is the same as a regular 38;5;<idx> sequence, but using sub-parameters instead (38:2:5:<idx>).
* csi: CSI h isn't a valid sequence - it needs a parameterDaniel Eklöf2019-08-30-5/+29
| | | | | And, 'insert mode' isn't activated with \e[h, but with \e[4h.
* term: rename colors256 -> tableDaniel Eklöf2019-08-21-6/+6
|
* term: use colors256 array for *all* colorsDaniel Eklöf2019-08-21-22/+7
| | | | | | That is, remove the 'regular' and 'bright' color arrays. This is possible since the 256-color array is defined such that the first 16 colors map to the regular and bright colors.
* csi: move 256-color table into the terminal structDaniel Eklöf2019-08-21-27/+2
|
* csi: implement CSI ? 1007 h/l - alternateScrollDaniel Eklöf2019-08-19-0/+8
| | | | | When enabled, mouse scrolls in the alternate screen are converted to up/down key presses.
* csi: cancel selection *before* switching gridDaniel Eklöf2019-08-08-3/+4
| | | | This fixes an occasional SIGSEGV
* csi: add 'unimplemented' warnings for things we handle but ignoreDaniel Eklöf2019-08-04-6/+19
|
* cell: pack more efficiently and store glyph as a wcharDaniel Eklöf2019-08-02-14/+24
| | | | | | | | | | | The 'attributes' struct is now 8 bytes and naturally packed (used to be 9 bytes, artificially packed). 'cell' struct is now 12 bytes, naturally packed (used to be 13 bytes, artificially packed). Furthermore, the glyph is stored as a wchar instead of a char*. This makes it easier (faster) to do glyph lookup when rendering.
* term: implement resetDaniel Eklöf2019-08-01-1/+1
|
* vt: remove almost all abort() callsDaniel Eklöf2019-07-30-62/+35
| | | | | | Replace with generic error log messages that simply says the ESC/CSI/OSC sequence is unhandled. This can mean either invalid or unimplemented, depending on the context.
* render: add a 'clean' bit to each cell; only render cells that aren't cleanDaniel Eklöf2019-07-30-10/+15
| | | | | | | | | | | This patch takes a bit from the foreground color value in a cell (todo: split up foreground/background into bitfields with a separate field for 'foreground/background' has been set), and only re-renders cells that aren't marked as clean. Note: we use a 'clean' bit rather than a 'dirty' bit to make it easy to erase cells - we can (keep doing) do that by simply memsetting a cell range to 0.
* csi: ignore CSI ?1036h/l (metaSendsEscape)Daniel Eklöf2019-07-23-0/+9
|