require escape to bgein and end any run of chars that represent a

block item.



SVN revision: 83398
This commit is contained in:
Carsten Haitzler 2013-01-29 03:34:50 +00:00
parent 3b9b38b86c
commit 6618fb3262
4 changed files with 27 additions and 7 deletions

View File

@ -2654,6 +2654,14 @@ _smart_pty_command(void *data)
}
return;
}
else if (sd->pty->cur_cmd[1] == 'b')
{
sd->pty->block.on = EINA_TRUE;
}
else if (sd->pty->cur_cmd[1] == 'e')
{
sd->pty->block.on = EINA_FALSE;
}
}
else if (sd->pty->cur_cmd[0] == 'q')
{

View File

@ -115,6 +115,7 @@ struct _Termpty
Eina_Hash *blocks;
Eina_List *active;
Eina_List *expecting;
Eina_Bool on : 1;
} block;
Termstate state, save, swap;
int exit_code;

View File

@ -1310,7 +1310,7 @@ _termpty_handle_seq(Termpty *ty, Eina_Unicode *c, Eina_Unicode *ce)
if (len == 0) return 0;
return 1 + len;
}
else if (ty->block.expecting)
else if ((ty->block.expecting) && (ty->block.on))
{
Termexp *ex;
Eina_List *l;

View File

@ -109,7 +109,7 @@ main(int argc, char **argv)
evas_object_image_size_get(o, &w, &h);
if ((w >= 0) && (h > 0))
{
int x, y;
int x, y, i;
char *line;
if ((tw <= 0) || (th <= 0) || (cw <= 1) || (ch <= 1))
@ -127,7 +127,7 @@ main(int argc, char **argv)
iw = (w + (cw - 1)) / cw;
ih = (h + (ch - 1)) / ch;
}
line = malloc(iw + 2);
line = malloc(iw + 100);
if (!line)
{
free(rp);
@ -143,12 +143,23 @@ main(int argc, char **argv)
snprintf(buf, sizeof(buf), "%c}is#%i;%i;%s",
0x1b, iw, ih, rp);
if (write(0, buf, strlen(buf) + 1) < 0) perror("write");
for (x = 0; x < iw; x++) line[x] = '#';
line[x++] = '\n';
line[x++] = 0;
i = 0;
line[i++] = 0x1b;
line[i++] = '}';
line[i++] = 'i';
line[i++] = 'b';
line[i++] = 0;
for (x = 0; x < iw; x++) line[i++] = '#';
line[i++] = 0x1b;
line[i++] = '}';
line[i++] = 'i';
line[i++] = 'e';
line[i++] = 0;
line[i++] = '\n';
line[i++] = 0;
for (y = 0; y < ih; y++)
{
if (write(0, line, iw + 1) < 0) perror("write");
if (write(0, line, i) < 0) perror("write");
}
free(line);
}