#include <windows.h>
-#ifndef AUTO_WINSOCK
-#ifdef WINSOCK_TWO
-#include <winsock2.h>
-#else
-#include <winsock.h>
-#endif
-#endif
#include <stdio.h>
#include <stdlib.h>
+#include <ctype.h>
#include "putty.h"
ctx = get_ctx();
if (ctx) {
if ( (seen_key_event && (cfg.scroll_on_key)) ||
- (seen_disp_event && (!cfg.scroll_on_key)) ) {
+ (seen_disp_event && (cfg.scroll_on_disp)) ) {
disptop = scrtop;
seen_disp_event = seen_key_event = 0;
+ update_sbar();
}
do_paint (ctx, TRUE);
sys_cursor(curs_x, curs_y + (scrtop - disptop) / (cols+1));
}
void term_paste() {
-static long last_paste = 0;
+ static long last_paste = 0;
long now, paste_diff;
if(paste_len == 0) return;
while(paste_pos<paste_len)
{
- char c = paste_buffer[paste_pos++];
- ldisc->send (&c, 1);
+ int n = 0;
+ while (n + paste_pos < paste_len) {
+ if (paste_buffer[paste_pos + n++] == '\r')
+ break;
+ }
+ ldisc->send (paste_buffer+paste_pos, n);
+ paste_pos += n;
- if (c =='\r') {
+ if (paste_pos < paste_len) {
paste_hold = 1;
return;
}
deselect();
term_update();
}
+
+/*
+ * from_backend(), to get data from the backend for the terminal.
+ */
+void from_backend(int is_stderr, char *data, int len) {
+ while (len--) {
+ if (inbuf_head >= INBUF_SIZE)
+ term_out();
+ inbuf[inbuf_head++] = *data++;
+ }
+}