View | Details | Raw Unified | Return to bug 1199 | Differences between
and this patch

Collapse All | Expand All

(-)ttymodes.c (-4 / +4 lines)
Lines 270-275 tty_make_modes(int fd, struct termios *t Link Here
270
	}
270
	}
271
271
272
	if (tiop == NULL) {
272
	if (tiop == NULL) {
273
		if (fd == -1) {
274
			debug("tty_make_modes: no fd or tio");
275
			goto end;
276
		}
273
		if (tcgetattr(fd, &tio) == -1) {
277
		if (tcgetattr(fd, &tio) == -1) {
274
			logit("tcgetattr: %.100s", strerror(errno));
278
			logit("tcgetattr: %.100s", strerror(errno));
275
			goto end;
279
			goto end;
Lines 289-300 tty_make_modes(int fd, struct termios *t Link Here
289
293
290
	/* Store values of mode flags. */
294
	/* Store values of mode flags. */
291
#define TTYCHAR(NAME, OP) \
295
#define TTYCHAR(NAME, OP) \
292
	debug3("tty_make_modes: %d %d", OP, tio.c_cc[NAME]); \
293
	buffer_put_char(&buf, OP); \
296
	buffer_put_char(&buf, OP); \
294
	put_arg(&buf, tio.c_cc[NAME]);
297
	put_arg(&buf, tio.c_cc[NAME]);
295
298
296
#define TTYMODE(NAME, FIELD, OP) \
299
#define TTYMODE(NAME, FIELD, OP) \
297
	debug3("tty_make_modes: %d %d", OP, ((tio.FIELD & NAME) != 0)); \
298
	buffer_put_char(&buf, OP); \
300
	buffer_put_char(&buf, OP); \
299
	put_arg(&buf, ((tio.FIELD & NAME) != 0));
301
	put_arg(&buf, ((tio.FIELD & NAME) != 0));
300
302
Lines 382-388 tty_parse_modes(int fd, int *n_bytes_ptr Link Here
382
	case OP: \
384
	case OP: \
383
	  n_bytes += arg_size; \
385
	  n_bytes += arg_size; \
384
	  tio.c_cc[NAME] = get_arg(); \
386
	  tio.c_cc[NAME] = get_arg(); \
385
	  debug3("tty_parse_modes: %d %d", OP, tio.c_cc[NAME]); \
386
	  break;
387
	  break;
387
#define TTYMODE(NAME, FIELD, OP) \
388
#define TTYMODE(NAME, FIELD, OP) \
388
	case OP: \
389
	case OP: \
Lines 391-397 tty_parse_modes(int fd, int *n_bytes_ptr Link Here
391
	    tio.FIELD |= NAME; \
392
	    tio.FIELD |= NAME; \
392
	  else \
393
	  else \
393
	    tio.FIELD &= ~NAME;	\
394
	    tio.FIELD &= ~NAME;	\
394
	  debug3("tty_parse_modes: %d %d", OP, arg); \
395
	  break;
395
	  break;
396
396
397
#include "ttymodes.h"
397
#include "ttymodes.h"
(-)sshtty.c (-2 / +2 lines)
Lines 45-54 Link Here
45
static struct termios _saved_tio;
45
static struct termios _saved_tio;
46
static int _in_raw_mode = 0;
46
static int _in_raw_mode = 0;
47
47
48
struct termios
48
struct termios *
49
get_saved_tio(void)
49
get_saved_tio(void)
50
{
50
{
51
	return _saved_tio;
51
	return _in_raw_mode ? &_saved_tio : NULL;
52
}
52
}
53
53
54
void
54
void
(-)sshpty.h (-1 / +1 lines)
Lines 16-22 Link Here
16
16
17
#include <termios.h>
17
#include <termios.h>
18
18
19
struct termios get_saved_tio(void);
19
struct termios *get_saved_tio(void);
20
void	 leave_raw_mode(void);
20
void	 leave_raw_mode(void);
21
void	 enter_raw_mode(void);
21
void	 enter_raw_mode(void);
22
22
(-)clientloop.c (-3 / +3 lines)
Lines 1711-1717 client_session2_setup(int id, int want_t Link Here
1711
1711
1712
	if (want_tty) {
1712
	if (want_tty) {
1713
		struct winsize ws;
1713
		struct winsize ws;
1714
		struct termios tio;
1715
1714
1716
		/* Store window size in the packet. */
1715
		/* Store window size in the packet. */
1717
		if (ioctl(in_fd, TIOCGWINSZ, &ws) < 0)
1716
		if (ioctl(in_fd, TIOCGWINSZ, &ws) < 0)
Lines 1724-1731 client_session2_setup(int id, int want_t Link Here
1724
		packet_put_int((u_int)ws.ws_row);
1723
		packet_put_int((u_int)ws.ws_row);
1725
		packet_put_int((u_int)ws.ws_xpixel);
1724
		packet_put_int((u_int)ws.ws_xpixel);
1726
		packet_put_int((u_int)ws.ws_ypixel);
1725
		packet_put_int((u_int)ws.ws_ypixel);
1727
		tio = get_saved_tio();
1726
		if (tiop == NULL)
1728
		tty_make_modes(-1, tiop != NULL ? tiop : &tio);
1727
			tiop = get_saved_tio();
1728
		tty_make_modes(-1, tiop);
1729
		packet_send();
1729
		packet_send();
1730
		/* XXX wait for reply */
1730
		/* XXX wait for reply */
1731
		c->client_tty = 1;
1731
		c->client_tty = 1;

Return to bug 1199