1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-05 21:42:47 -05:00

Fix pasting of newlines in local line editing mode. Possibly not a

very _good_ fix; something might want doing after the release.

[originally from svn r1277]
This commit is contained in:
Simon Tatham
2001-09-19 20:07:15 +00:00
parent 6364ff3e71
commit 39c3f9b8bc
9 changed files with 42 additions and 44 deletions

View File

@ -292,7 +292,7 @@ static void power_on(void)
big_cursor = 0;
save_attr = curr_attr = ATTR_DEFAULT;
term_editing = term_echoing = FALSE;
ldisc_send(NULL, 0); /* cause ldisc to notice changes */
ldisc_send(NULL, 0, 0); /* cause ldisc to notice changes */
app_cursor_keys = cfg.app_cursor;
app_keypad_keys = cfg.app_keypad;
use_bce = cfg.bce;
@ -902,7 +902,7 @@ static void toggle_mode(int mode, int query, int state)
break;
case 10: /* set local edit mode */
term_editing = state;
ldisc_send(NULL, 0); /* cause ldisc to notice changes */
ldisc_send(NULL, 0, 0); /* cause ldisc to notice changes */
break;
case 25: /* enable/disable cursor */
compatibility2(OTHER, VT220);
@ -931,7 +931,7 @@ static void toggle_mode(int mode, int query, int state)
break;
case 12: /* set echo mode */
term_echoing = !state;
ldisc_send(NULL, 0); /* cause ldisc to notice changes */
ldisc_send(NULL, 0, 0); /* cause ldisc to notice changes */
break;
case 20: /* Return sends ... */
cr_lf_return = state;
@ -1188,7 +1188,7 @@ void term_out(void)
} else
*d++ = *s;
}
lpage_send(CP_ACP, abuf, d - abuf);
lpage_send(CP_ACP, abuf, d - abuf, 0);
}
break;
case '\007':
@ -1494,7 +1494,7 @@ void term_out(void)
break;
case 'Z': /* terminal type query */
compatibility(VT100);
ldisc_send(id_string, strlen(id_string));
ldisc_send(id_string, strlen(id_string), 0);
break;
case 'c': /* restore power-on settings */
compatibility(VT100);
@ -1646,7 +1646,7 @@ void term_out(void)
compatibility(OTHER);
/* this reports xterm version 136 so that VIM can
use the drag messages from the mouse reporting */
ldisc_send("\033[>0;136;0c", 11);
ldisc_send("\033[>0;136;0c", 11, 0);
break;
case 'a': /* move right N cols */
compatibility(ANSI);
@ -1742,16 +1742,16 @@ void term_out(void)
case 'c': /* terminal type query */
compatibility(VT100);
/* This is the response for a VT102 */
ldisc_send(id_string, strlen(id_string));
ldisc_send(id_string, strlen(id_string), 0);
break;
case 'n': /* cursor position query */
if (esc_args[0] == 6) {
char buf[32];
sprintf(buf, "\033[%d;%dR", curs.y + 1,
curs.x + 1);
ldisc_send(buf, strlen(buf));
ldisc_send(buf, strlen(buf), 0);
} else if (esc_args[0] == 5) {
ldisc_send("\033[0n", 4);
ldisc_send("\033[0n", 4, 0);
}
break;
case 'h': /* toggle modes to high */
@ -2011,7 +2011,7 @@ void term_out(void)
if (i == 0 || i == 1) {
strcpy(buf, "\033[2;1;1;112;112;1;0x");
buf[2] += i;
ldisc_send(buf, 20);
ldisc_send(buf, 20, 0);
}
}
break;
@ -2328,7 +2328,7 @@ void term_out(void)
termstate = VT52_Y1;
break;
case 'Z':
ldisc_send("\033/Z", 3);
ldisc_send("\033/Z", 3, 0);
break;
case '=':
app_keypad_keys = TRUE;
@ -3150,7 +3150,7 @@ void term_do_paste(void)
/* Assume a small paste will be OK in one go. */
if (paste_len < 256) {
luni_send(paste_buffer, paste_len);
luni_send(paste_buffer, paste_len, 0);
if (paste_buffer)
sfree(paste_buffer);
paste_buffer = 0;
@ -3241,7 +3241,7 @@ void term_mouse(Mouse_Button b, Mouse_Action a, int x, int y,
c = x + 33;
sprintf(abuf, "\033[M%c%c%c", encstate, c, r);
ldisc_send(abuf, 6);
ldisc_send(abuf, 6, 0);
return;
}
@ -3337,7 +3337,7 @@ void term_paste()
if (paste_buffer[paste_pos + n++] == '\r')
break;
}
luni_send(paste_buffer + paste_pos, n);
luni_send(paste_buffer + paste_pos, n, 0);
paste_pos += n;
if (paste_pos < paste_len) {