version 1.28, 2009/08/31 20:46:19 |
version 1.29, 2009/09/01 09:11:05 |
|
|
struct screen_write_ctx ctx; |
struct screen_write_ctx ctx; |
struct session *s = c->session; |
struct session *s = c->session; |
struct screen old_status; |
struct screen old_status; |
size_t i, size, left, len, off, n; |
size_t i, size, left, len, off; |
char ch; |
char ch; |
struct grid_cell gc; |
struct grid_cell gc; |
|
|
|
|
left--; |
left--; |
size = left; |
size = left; |
} |
} |
if (c->prompt_flags & PROMPT_HIDDEN) { |
if (c->prompt_flags & PROMPT_HIDDEN) |
n = strlen(c->prompt_buffer); |
size = 0; |
if (n > left) |
else { |
n = left; |
|
for (i = 0; i < n; i++) |
|
screen_write_putc(&ctx, &gc, '*'); |
|
} else { |
|
screen_write_puts(&ctx, &gc, |
screen_write_puts(&ctx, &gc, |
"%.*s", (int) left, c->prompt_buffer + off); |
"%.*s", (int) left, c->prompt_buffer + off); |
} |
} |
|
|
screen_write_putc(&ctx, &gc, ' '); |
screen_write_putc(&ctx, &gc, ' '); |
|
|
/* Draw a fake cursor. */ |
/* Draw a fake cursor. */ |
screen_write_cursormove(&ctx, len + c->prompt_index - off, 0); |
ch = ' '; |
if (c->prompt_index == strlen(c->prompt_buffer)) |
if (c->prompt_flags & PROMPT_HIDDEN) |
ch = ' '; |
screen_write_cursormove(&ctx, len, 0); |
else { |
else { |
if (c->prompt_flags & PROMPT_HIDDEN) |
screen_write_cursormove(&ctx, |
ch = '*'; |
len + c->prompt_index - off, 0); |
else |
if (c->prompt_index < strlen(c->prompt_buffer)) |
ch = c->prompt_buffer[c->prompt_index]; |
ch = c->prompt_buffer[c->prompt_index]; |
} |
} |
if (ch == '\0') |
|
ch = ' '; |
|
gc.attr ^= GRID_ATTR_REVERSE; |
gc.attr ^= GRID_ATTR_REVERSE; |
screen_write_putc(&ctx, &gc, ch); |
screen_write_putc(&ctx, &gc, ch); |
} |
} |