Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 59359 - copy/paste in gnome-terminal displaces text
Summary: copy/paste in gnome-terminal displaces text
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-04 02:25 UTC by b52
Modified: 2004-10-17 14:11 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description b52 2004-08-04 02:25:04 UTC
Hi,
when i try to copy paste something with mouseclick into a gnome-terminal it displaces the pastet text. Its realy annoying.
For example:
Original in mozilla:
-------------------------------------------------------------------------------

#include <curses.h>
#include <signal.h>

static void finish(int sig);

int
main(int argc, char *argv[])
{
    int num = 0;

    /* initialize your non-curses data structures here */

    (void) signal(SIGINT, finish);      /* arrange interrupts to terminate */

    (void) initscr();      /* initialize the curses library */
    keypad(stdscr, TRUE);  /* enable keyboard mapping */
    (void) nonl();         /* tell curses not to do NL->CR/NL on output */
    (void) cbreak();       /* take input chars one at a time, no wait for \n */
    (void) echo();         /* echo input - in color */

    if (has_colors())
    {
        start_color();

        /*
         * Simple color assignment, often all we need.  Color pair 0 cannot
	 * be redefined.  This example uses the same value for the color
	 * pair as for the foreground color, though of course that is not
	 * necessary:
         */
        init_pair(1, COLOR_RED,     COLOR_BLACK);
        init_pair(2, COLOR_GREEN,   COLOR_BLACK);
        init_pair(3, COLOR_YELLOW,  COLOR_BLACK);
        init_pair(4, COLOR_BLUE,    COLOR_BLACK);
        init_pair(5, COLOR_CYAN,    COLOR_BLACK);
        init_pair(6, COLOR_MAGENTA, COLOR_BLACK);
        init_pair(7, COLOR_WHITE,   COLOR_BLACK);
    }

    for (;;)
    {
        int c = getch();     /* refresh, accept single keystroke of input */
	attrset(COLOR_PAIR(num % 8));
	num++;

        /* process the command keystroke */
    }

    finish(0);               /* we're done */
}

static void finish(int sig)
{
    endwin();

    /* do your non-curses wrapup here */

    exit(0);
}
-------------------------------------------------------------------------------
After pasting into gnome-terminal:
-------------------------------------------------------------------------------
#include <curses.h>
#include <signal.h>

static void finish(int sig);

int
main(int argc, char *argv[])
{
    int num = 0;

        /* initialize your non-curses data structures here */

            (void) signal(SIGINT, finish);      /* arrange interrupts to terminate */

                (void) initscr();      /* initialize the curses library */
                    keypad(stdscr, TRUE);  /* enable keyboard mapping */
                        (void) nonl();         /* tell curses not to do NL->CR/NL on output */
                            (void) cbreak();       /* take input chars one at a time, no wait for \n */
                                (void) echo();         /* echo input - in color */

                                    if (has_colors())
                                        {
                                                start_color();

                                                        /*
                                                                 * Simple color assignment, often all we need.  Color pair 0 cannot
                                                                         * be redefined.  This example uses the same value for the color
                                                                                 * pair as for the foreground color, though of course that is not                                                                                         * necessary:
                                                                                                  */
                                                                                                          init_pair(1, COLOR_RED,     COLOR_BLACK);
                                                                                                                  init_pair(2, COLOR_GREEN,   COLOR_BLACK);
                                                                                                                          init_pair(3, COLOR_YELLOW,  COLOR_BLACK);
                                                                                                                                  init_pair(4, COLOR_BLUE,    COLOR_BLACK);
                                                                                                                                          init_pair(5, COLOR_CYAN,    COLOR_BLACK);
  init_pair(6, COLOR_MAGENTA, COLOR_BLACK);
          init_pair(7, COLOR_WHITE,   COLOR_BLACK);
              }
                   for (;;)                       {
                              int c = getch();     /* refresh, accept single keystroke of input */

                               attrset(COLOR_PAIR(num % 8));

                                       num++;


                                               /* process the command keystroke */

                                                   }


                                                       finish(0);               /* we're done */

                                                       }


                                                       static void finish(int sig)

                                                       {

                                                           endwin();


                                                               /* do your non-curses wrapup here */


                                                                   exit(0);

                                                                   }
--------------------------------------------------------------------------------

Reproducible: Always
Steps to Reproduce:
1.Copy text where some lines begin with tabs e.g. from mozilla
2.Paste text in gnome-terminal
3.

Actual Results:  
displaced output

Expected Results:  
same output as input

I use gnome-terminal 2.6.1

Portage 2.0.50-r9 (default-x86-1.4, gcc-3.3.4, glibc-2.3.4.20040619-r0,
2.6.7-gentoo-r10)
=================================================================
System uname: 2.6.7-gentoo-r10 i686 Intel(R) Pentium(R) M processor 1300MHz
Gentoo Base System version 1.5.2
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium3 -mcpu=pentium3 -funroll-loops -pipe
-fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config
/usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/init.d /etc/snort /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium3 -mcpu=pentium3 -funroll-loops -pipe
-fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distcc sandbox"
GENTOO_MIRRORS="http://gentoo.inode.at ftp://gentoo.inode.at/source
rsync://rsync.fhh.opensource-mirror.de/gentoo
http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/
ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/
rsync://linux.rz.ruhr-uni-bochum.de/gentoo/
http://mirrors.sec.informatik.tu-darmstadt.de/gentoo
rsync://mirrors.sec.informatik.tu-darmstadt.de/gentoo
http://ftp.uni-erlangen.de/pub/mirrors/gentoo
ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo
ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo
rsync://ftp.join.uni-muenster.de/gentoo/
ftp://ftp.tu-clausthal.de/pub/linux/gentoo/
ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X X509 aalib acpi alsa arts autofs avi berkdb cdr cgi crypt cups dga encode
esd ethereal fbcon ffmpeg foomaticdb gdbm gif gnome gphoto2 gpm gstreamer gtk
gtk2 imap imlib ipv6 irda irmc java javascript jpeg kde lcd ldap libg++ libwww
mad maildir md5sum mikmod mmx motif mozcalendar mozilla mpeg mpeg4 ncurses nls
oav oggvorbis opengl oss pam pcmcia pdflib perl png pnp python qt quicktime
readline samba sdl slang snmp socks5 spell ssl svga tcltk tcpd tiff transcode
transparent-proxy truetype unicode usb vim-with-x wavelan wmf x86 xchattext xml2
xmms xv zlib"
Comment 1 Mike Gardiner (RETIRED) gentoo-dev 2004-08-06 04:40:54 UTC
Right, so it keeps adding the tabs, this belongs upstream - we need to post up there when we can, or you can reporter.
Comment 2 foser (RETIRED) gentoo-dev 2004-08-06 04:48:50 UTC
in what app do you paste it ?
Comment 3 b52 2004-08-06 05:04:27 UTC
    Mike Gardiner  2004-08-06 04:40 PST wrote:
    "...we need to post up there when we can, or you can reporter."
    ???????


I pasted it in vim, which was running in a gnome-terminal
Comment 4 foser (RETIRED) gentoo-dev 2004-08-06 05:15:29 UTC
cause nano does it alright, but i'm no big man for the console editors, so i don't know much about that. Could it be vim/g-t specific ?
Comment 5 Aaron Walker (RETIRED) gentoo-dev 2004-08-06 06:52:24 UTC
I can reproduce this in nano, here, so it's definitely not a vim-specific thing.
Comment 6 foser (RETIRED) gentoo-dev 2004-08-06 10:46:56 UTC
so what version of gnome-terminal are you guys using ?
Comment 7 foser (RETIRED) gentoo-dev 2004-08-06 10:47:18 UTC
and vte version as well (sorry forgot) ?
Comment 8 Aaron Walker (RETIRED) gentoo-dev 2004-08-06 11:45:02 UTC
gnome-terminal-2.6.1
vte-0.11.11
Comment 9 b52 2004-08-06 12:09:21 UTC
I use vte-0.11.11 and gnome-terminal-2.6.1
Comment 10 Torsten Veller (RETIRED) gentoo-dev 2004-09-30 23:46:44 UTC
Does this only happen in gnome-terminal?
If not: Did you turn off auto-indent in your application?

in vim type:
<ESC> :set paste
or
<ESC> :set noai

in nano (which i don't use) the help page says:
M-I   toggle auto-indent
Comment 11 Alastair Tse (RETIRED) gentoo-dev 2004-10-17 14:11:29 UTC
this looks like the console editor doing auto-indenting on top of the tabs cut and pasted from the clipboard. i don't think its a gnome-terminal issue. works fine for me in both nano and vi which doesn't have auto-indent turned on.