Prepare TERM in buffer before sending; this allows size to be part of cmd and prevents it being split. This is the only place this happens so remove it from todo.

This commit is contained in:
Nicholas Marriott 2008-06-01 21:24:33 +00:00
parent 693231e8eb
commit 11ee55e755
2 changed files with 8 additions and 5 deletions

2
TODO
View File

@ -71,8 +71,6 @@
- different screen model? layers perhaps? hmm - different screen model? layers perhaps? hmm
-- For 0.3 -------------------------------------------------------------------- -- For 0.3 --------------------------------------------------------------------
- anything which uses cmd_{send,recv}_string will break if the string is
split. string length should be part of the command size
- chmod +x socket when any client is attached (upd in lost/accept) - chmod +x socket when any client is attached (upd in lost/accept)
- clear EOL etc CANNOT rely on term using the current colour/attr and probably - clear EOL etc CANNOT rely on term using the current colour/attr and probably
should not emulate it doing so should not emulate it doing so

View File

@ -1,4 +1,4 @@
/* $Id: client.c,v 1.26 2008-05-31 20:04:15 nicm Exp $ */ /* $Id: client.c,v 1.27 2008-06-01 21:24:33 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -44,6 +44,7 @@ client_init(const char *path, struct client_ctx *cctx, int start_server)
size_t size; size_t size;
int mode; int mode;
u_int retries; u_int retries;
struct buffer *b;
retries = 0; retries = 0;
retry: retry:
@ -99,8 +100,12 @@ retry:
data.sy = ws.ws_row; data.sy = ws.ws_row;
if (ttyname_r(STDIN_FILENO, data.tty, sizeof data.tty) != 0) if (ttyname_r(STDIN_FILENO, data.tty, sizeof data.tty) != 0)
fatal("ttyname_r failed"); fatal("ttyname_r failed");
client_write_server(cctx, MSG_IDENTIFY, &data, sizeof data);
cmd_send_string(cctx->srv_out, getenv("TERM")); b = buffer_create(BUFSIZ);
cmd_send_string(b, getenv("TERM"));
client_write_server2(cctx, MSG_IDENTIFY,
&data, sizeof data, BUFFER_OUT(b), BUFFER_USED(b));
buffer_destroy(b);
} }
return (0); return (0);