diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c
index eb2c429..1458d11 100644
--- a/src/gui/gui-bar.c
+++ b/src/gui/gui-bar.c
@@ -323,6 +323,45 @@ gui_bar_find_pos (struct t_gui_bar *bar)
 }
 
 /*
+ * gui_bar_find_item_in_bar: find item in a specific bar or in all bars
+ *                           return 2 if bar_item was found
+ *                                  1 if bar_item was found and bar is hidden
+ *                                  0 if bar_item or bar wasn't found
+ *
+ */
+
+int
+gui_bar_find_item_in_bar (const char *bar_name,const char *item_name)
+{
+    struct t_gui_bar *ptr_bar;
+    int bar_item_found;
+
+    bar_item_found = 0;
+    if (bar_name)
+    {
+        ptr_bar = gui_bar_search (bar_name);
+        if ((ptr_bar)
+            && (strstr (CONFIG_STRING(ptr_bar->options[GUI_BAR_OPTION_ITEMS]), item_name)))
+            {
+                if (CONFIG_BOOLEAN(ptr_bar->options[GUI_BAR_OPTION_HIDDEN]))
+                    return 1;
+                return 2;
+            }
+    }
+    else
+    {
+        for (ptr_bar = gui_bars; ptr_bar; ptr_bar = ptr_bar->next_bar)
+        {
+            if ((ptr_bar)
+                && (strstr (CONFIG_STRING(ptr_bar->options[GUI_BAR_OPTION_ITEMS]), item_name)))
+                bar_item_found = ((bar_item_found < 1) && (CONFIG_BOOLEAN(ptr_bar->options[GUI_BAR_OPTION_HIDDEN]))) ? 1:2;
+        }
+    }
+
+    return bar_item_found;
+}
+
+/*
  * gui_bar_insert: insert a bar to the list (at good position, according to
  *                 priority)
  */
diff --git a/src/gui/gui-bar.h b/src/gui/gui-bar.h
index 6743f9f..bbf4c0c 100644
--- a/src/gui/gui-bar.h
+++ b/src/gui/gui-bar.h
@@ -120,6 +120,7 @@ extern int gui_bar_check_conditions_for_window (struct t_gui_bar *bar,
 extern int gui_bar_root_get_size (struct t_gui_bar *bar,
                                   enum t_gui_bar_position position);
 extern struct t_gui_bar *gui_bar_search (const char *name);
+extern int gui_bar_find_item_in_bar (const char *bar_name,const char *item_name);
 extern void gui_bar_ask_refresh (struct t_gui_bar *bar);
 extern void gui_bar_draw (struct t_gui_bar *bar);
 extern int gui_bar_set (struct t_gui_bar *bar, const char *property, const char *value);
diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c
index 6c338ea..377102b 100644
--- a/src/gui/gui-key.c
+++ b/src/gui/gui-key.c
@@ -1584,17 +1584,19 @@ gui_key_paste_check (int bracketed_paste)
     int max_lines;
 
     max_lines = CONFIG_INTEGER(config_look_paste_max_lines);
-    if (max_lines >= 0)
-    {
-        if (!bracketed_paste && (max_lines == 0))
-            max_lines = 1;
-        if (gui_key_get_paste_lines () > max_lines)
+
+    /* search for item "input_paste" in all bars */
+    if ((max_lines < 0) || (gui_bar_find_item_in_bar(NULL,"input_paste")) < 2)
+        return 0;
+
+    if (!bracketed_paste && (max_lines == 0))
+        max_lines = 1;
+    if (gui_key_get_paste_lines () > max_lines)
         {
             /* ask user what to do */
             gui_key_paste_start ();
             return 1;
         }
-    }
 
     return 0;
 }
