mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Flush data on tty open. Also reset colour before clearing line/screen.
This commit is contained in:
parent
7034ba236f
commit
c6384a765b
4
TODO
4
TODO
@ -57,7 +57,9 @@
|
|||||||
- lift SHRT_MAX limits for history
|
- lift SHRT_MAX limits for history
|
||||||
- audit copy/scroll and other modes for problems with very small windows
|
- audit copy/scroll and other modes for problems with very small windows
|
||||||
- screen_draw_* moved out/renamed (accept TTY_*?)
|
- screen_draw_* moved out/renamed (accept TTY_*?)
|
||||||
- SIGWINCH can probably be handled in server
|
|
||||||
|
|
||||||
-- For 0.2 --------------------------------------------------------------------
|
-- For 0.2 --------------------------------------------------------------------
|
||||||
- window splitting?
|
- window splitting?
|
||||||
|
- restore term cap checks
|
||||||
|
- anything which uses cmd_{send,recv}_string will break if the string is
|
||||||
|
split. string length should be part of the command size
|
||||||
|
6
screen.c
6
screen.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: screen.c,v 1.51 2007-11-27 19:32:15 nicm Exp $ */
|
/* $Id: screen.c,v 1.52 2007-11-27 21:07:38 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -458,6 +458,7 @@ screen_draw_clear_screen(struct screen_draw_ctx *ctx)
|
|||||||
{
|
{
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
|
screen_draw_set_attributes(ctx, SCREEN_DEFATTR, SCREEN_DEFCOLR);
|
||||||
for (i = 0; i < screen_size_y(ctx->s); i++) {
|
for (i = 0; i < screen_size_y(ctx->s); i++) {
|
||||||
screen_draw_move_cursor(ctx, 0, i);
|
screen_draw_move_cursor(ctx, 0, i);
|
||||||
screen_draw_clear_line_to(ctx, screen_size_x(ctx->s));
|
screen_draw_clear_line_to(ctx, screen_size_x(ctx->s));
|
||||||
@ -568,11 +569,12 @@ screen_draw_line(struct screen_draw_ctx *ctx, u_int py)
|
|||||||
cx = ctx->s->grid_size[cy];
|
cx = ctx->s->grid_size[cy];
|
||||||
|
|
||||||
if (ctx->sel.flag ||
|
if (ctx->sel.flag ||
|
||||||
screen_size_x(ctx->s) < 3 || cx >= screen_size_x(ctx->s) - 3)
|
screen_size_x(ctx->s) < 5 || cx >= screen_size_x(ctx->s) - 5)
|
||||||
screen_draw_cells(ctx, 0, py, screen_size_x(ctx->s));
|
screen_draw_cells(ctx, 0, py, screen_size_x(ctx->s));
|
||||||
else {
|
else {
|
||||||
screen_draw_cells(ctx, 0, py, cx);
|
screen_draw_cells(ctx, 0, py, cx);
|
||||||
screen_draw_move_cursor(ctx, cx, py);
|
screen_draw_move_cursor(ctx, cx, py);
|
||||||
|
screen_draw_set_attributes(ctx, SCREEN_DEFATTR, SCREEN_DEFCOLR);
|
||||||
ctx->write(ctx->data, TTY_CLEARENDOFLINE);
|
ctx->write(ctx->data, TTY_CLEARENDOFLINE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
8
tty.c
8
tty.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: tty.c,v 1.4 2007-11-27 20:01:30 nicm Exp $ */
|
/* $Id: tty.c,v 1.5 2007-11-27 21:07:38 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -51,7 +51,7 @@ int
|
|||||||
tty_open(struct tty *tty, char **cause)
|
tty_open(struct tty *tty, char **cause)
|
||||||
{
|
{
|
||||||
struct termios tio;
|
struct termios tio;
|
||||||
int error;
|
int error, what;
|
||||||
|
|
||||||
tty->fd = open(tty->path, O_RDWR|O_NONBLOCK);
|
tty->fd = open(tty->path, O_RDWR|O_NONBLOCK);
|
||||||
if (tty->fd == -1) {
|
if (tty->fd == -1) {
|
||||||
@ -103,6 +103,10 @@ tty_open(struct tty *tty, char **cause)
|
|||||||
if (tcsetattr(tty->fd, TCSANOW, &tio) != 0)
|
if (tcsetattr(tty->fd, TCSANOW, &tio) != 0)
|
||||||
fatal("tcsetattr failed");
|
fatal("tcsetattr failed");
|
||||||
|
|
||||||
|
what = 0;
|
||||||
|
if (ioctl(tty->fd, TIOCFLUSH, &what) != 0)
|
||||||
|
fatal("ioctl(TIOCFLUSH)");
|
||||||
|
|
||||||
if (enter_ca_mode != NULL)
|
if (enter_ca_mode != NULL)
|
||||||
tty_puts(tty, enter_ca_mode);
|
tty_puts(tty, enter_ca_mode);
|
||||||
if (keypad_xmit != NULL)
|
if (keypad_xmit != NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user