summarylogtreecommitdiffstats
path: root/bracketed_paste_mode_fix.patch
blob: c41ca6f8ff43ccfb12893468cab3273f6cff32fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
commit 7206376160aac2743a93f70a4726bad4f34fa688
Author: Fuujuhi <fuujuhi-ml1@noekeon.org>
Date:   Wed Jul 30 15:52:52 2014 +0200

    backporting vte bracked paste mode bug patch on v0.28.2-5ubuntu1
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=729533
    Patch at https://bugzilla.gnome.org/attachment.cgi?id=279320

diff --git a/src/vte-private.h b/src/vte-private.h
index 65d5022..ac1f2d8 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -219,7 +219,6 @@ struct _VteTerminalPrivate {
 		gboolean sendrecv_mode;	/* sendrecv mode */
 		gboolean insert_mode;	/* insert mode */
 		gboolean linefeed_mode;	/* linefeed mode */
-		gboolean bracketed_paste_mode;
 		struct vte_scrolling_region {
 			int start, end;
 		} scrolling_region;	/* the region we scroll in */
@@ -274,6 +273,7 @@ struct _VteTerminalPrivate {
 	gboolean text_modified_flag;
 	gboolean text_inserted_flag;
 	gboolean text_deleted_flag;
+	gboolean bracketed_paste_mode;
 
 	/* Scrolling options. */
 	gboolean scroll_background;
diff --git a/src/vte.c b/src/vte.c
index c20ee78..dbab6de 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -5823,10 +5823,10 @@ static void mark_output_source_invalid(VteTerminal *terminal)
 				p++;
 			}
 		}
-		if (terminal->pvt->screen->bracketed_paste_mode)
+		if (terminal->pvt->bracketed_paste_mode)
 			vte_terminal_feed_child(terminal, "\e[200~", -1);
 		vte_terminal_feed_child(terminal, paste, length);
-		if (terminal->pvt->screen->bracketed_paste_mode)
+		if (terminal->pvt->bracketed_paste_mode)
 			vte_terminal_feed_child(terminal, "\e[201~", -1);
 		g_free(paste);
 	}
@@ -14106,14 +14106,12 @@ static void mark_output_source_invalid(VteTerminal *terminal)
 	pvt->normal_screen.linefeed_mode = FALSE;
 	pvt->normal_screen.origin_mode = FALSE;
 	pvt->normal_screen.reverse_mode = FALSE;
-	pvt->normal_screen.bracketed_paste_mode = FALSE;
 	pvt->alternate_screen.scrolling_restricted = FALSE;
 	pvt->alternate_screen.sendrecv_mode = TRUE;
 	pvt->alternate_screen.insert_mode = FALSE;
 	pvt->alternate_screen.linefeed_mode = FALSE;
 	pvt->alternate_screen.origin_mode = FALSE;
 	pvt->alternate_screen.reverse_mode = FALSE;
-	pvt->alternate_screen.bracketed_paste_mode = FALSE;
 	pvt->cursor_visible = TRUE;
 	/* Reset the encoding. */
 	vte_terminal_set_encoding(terminal, NULL);
@@ -14143,6 +14141,8 @@ static void mark_output_source_invalid(VteTerminal *terminal)
 	pvt->mouse_last_y = 0;
 	/* Clear modifiers. */
 	pvt->modifiers = 0;
+	/* Reset miscellaneous stuff. */
+	pvt->bracketed_paste_mode = FALSE;
 	/* Cause everything to be redrawn (or cleared). */
 	vte_terminal_maybe_scroll_to_bottom(terminal);
 	_vte_invalidate_all(terminal);
diff --git a/src/vteseq.c b/src/vteseq.c
index 209522f..8c8d43c 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -737,7 +737,7 @@
 		 GINT_TO_POINTER(TRUE),
 		 NULL, NULL},
 		/* 2004: Bracketed paste mode. */
-		{2004, &terminal->pvt->screen->bracketed_paste_mode, NULL, NULL,
+		{2004, &terminal->pvt->bracketed_paste_mode, NULL, NULL,
 		 GINT_TO_POINTER(FALSE),
 		 GINT_TO_POINTER(TRUE),
 		 NULL, NULL,},