[Xfce4-commits] [apps/xfce4-terminal] 01/01: Convert LF to CR when feeding text

noreply at xfce.org noreply at xfce.org
Tue Apr 9 16:41:02 CEST 2019


This is an automated email from the git hooks/post-receive script.

f   2   4   0   4       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-terminal.

commit 86d39718df51d5cf3991daa4832acd2d5e9dfef5
Author: Igor <f2404 at yandex.ru>
Date:   Tue Apr 9 10:39:56 2019 -0400

    Convert LF to CR when feeding text
    
    Fixes pasting text to some apps (see https://gitlab.gnome.org/GNOME/vte/issues/106).
---
 terminal/terminal-screen.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 18cce01..03bb5c0 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -1838,6 +1838,12 @@ terminal_screen_paste_unsafe_text (TerminalScreen *screen,
 
       if (res_text != NULL)
         {
+          /* convert LF to CR before feeding: see https://gitlab.gnome.org/GNOME/vte/issues/106 */
+          size_t i;
+          for (i = 0; i < strlen (res_text); ++i)
+            if (res_text[i] == '\x0A')
+              res_text[i] = '\x0D';
+
           vte_terminal_feed_child (VTE_TERMINAL (screen->terminal), res_text, strlen (res_text));
           g_free (res_text);
         }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list