mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-24 09:05:48 -04:00
csi: implement REP - CSI Ps b
This commit is contained in:
parent
2c8b31204f
commit
4e87426712
3 changed files with 18 additions and 0 deletions
16
csi.c
16
csi.c
|
|
@ -324,6 +324,22 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
switch (term->vt.private[0]) {
|
switch (term->vt.private[0]) {
|
||||||
case 0: {
|
case 0: {
|
||||||
switch (final) {
|
switch (final) {
|
||||||
|
case 'b':
|
||||||
|
if (term->vt.last_printed != 0) {
|
||||||
|
/*
|
||||||
|
* Note: we never reset 'last-printed'. According to
|
||||||
|
* ECMA-48, the behaviour is undefined if REP was
|
||||||
|
* _not_ preceeded by a graphical character.
|
||||||
|
*/
|
||||||
|
int count = vt_param_get(term, 0, 1);
|
||||||
|
LOG_DBG("REP: '%C' %d times", term->vt.last_printed, count);
|
||||||
|
|
||||||
|
const int width = wcwidth(term->vt.last_printed);
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
term_print(term, term->vt.last_printed, width);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 'c': {
|
case 'c': {
|
||||||
/* Send Device Attributes (Primary DA) */
|
/* Send Device Attributes (Primary DA) */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,7 @@ foot+base|foot base fragment,
|
||||||
kri=\E[1;2A,
|
kri=\E[1;2A,
|
||||||
op=\E[39;49m,
|
op=\E[39;49m,
|
||||||
rc=\E8,
|
rc=\E8,
|
||||||
|
rep=%p1%c\E[%p2%{1}%-%db,
|
||||||
rev=\E[7m,
|
rev=\E[7m,
|
||||||
ri=\EM,
|
ri=\EM,
|
||||||
rin=\E[%p1%dT,
|
rin=\E[%p1%dT,
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,7 @@ struct vt_param {
|
||||||
|
|
||||||
struct vt {
|
struct vt {
|
||||||
int state; /* enum state */
|
int state; /* enum state */
|
||||||
|
wchar_t last_printed;
|
||||||
struct {
|
struct {
|
||||||
struct vt_param v[16];
|
struct vt_param v[16];
|
||||||
size_t idx;
|
size_t idx;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue