[Konsole-devel] Fwd: copying tab characters under konsole

Arkadiusz Miskiewicz arekm at maven.pl
Sun Aug 3 01:22:56 UTC 2008


On Saturday 02 August 2008, Robert Knight wrote:
> Hello,
>
> As you can see from the comments on the gnome bug report the fix is
> not trivial and is probably not suitable for KDE 3.5 as
> I cannot be sure that it won't break anything. 

Well, fix for KDE 4.x would be nice, too of course.

> At the moment I have a 
> feeling that tab -> space conversion is done by
> the kernel in its terminal code although you'd need to check that.

Seems so, but still, konsole could handle that in similar way to gnome vte, 
right?

> You're welcome to look at the KDE 3 or KDE 4 code though to find
> out what is involved.

Looking at this (though I have 0 knowledge about this code).

> If you just want a tab to behave as a character equal to a fixed
> number of spaces then it might be sufficient to:
>
> 1.  Make sure that the terminal (see Pty::start() ) is setup so that
> it doesn't do space -> tab conversion.

Can this be done? kernel driver/char/n_tty.c always replaces \t with spaces 
(well, depends on  OPOST flag but I don't see any flags setting in konsole 
code)

> 2.  Change konsole_wcwidth() to return 4 or 8 as the width of a tab
> character.

That won't work I guess. Character has to end as tab to have copying via mouse 
to work properly. That's the whole idea: echo -e "a\tb\tc", copy that with 
mouse, paste into kwrite and still have tabs not spaces (spaces is current 
broken behaviour in konsole).

> Regards,
> Robert.
>
> 2008/8/2 Kurt Hindenburg <kurt.hindenburg at gmail.com>:
> > I'll send this the konsole devel mailing list.
> >
> > ---------- Forwarded message ----------
> > From: Arkadiusz Miskiewicz <arekm at maven.pl>
> > Date: Fri, Aug 1, 2008 at 3:34 PM
> > Subject: copying tab characters under konsole
> > To: kurt.hindenburg at kdemail.net
> >
> >
> >
> > Hi,
> >
> > I'm trying to figure out which part of kde konsole code needs to be
> > changed to
> > correctly hangle copying of \t characters via mouse.
> >
> > Right now doing this:
> >
> > cat x-file-with-tabs-inside
> > select with mouse
> > cat - > y
> > paste with mouse
> > ctrl+d
> >
> > makes that tab characters are replaced with spaces instead of keeping
> > tabs untouched.
> >
> > I'm interested in fixing this behaviour in 3.5 konsole (there is going to
> > be 3.5.10 as I see on kde-packager mailing list) but I also tested on
> > konsole from 4.1 and here it also doesn't work properly.
> >
> > Could you help me with this issue?
> >
> > Thanks,
> >
> > ps. gnome-terminal managed to fix this by doing:
> >
> > http://bugzilla.gnome.org/buglist.cgi?query=353610
> >
> > http://svn.gnome.org/viewvc/vte/trunk/src/vteseq.c?r1=1990&r2=1996
> > --
> > Arkadiusz Miśkiewicz        PLD/Linux Team
> > arekm / maven.pl            http://ftp.pld-linux.org/
> >
> >
> > _______________________________________________
> > konsole-devel mailing list
> > konsole-devel at kde.org
> > https://mail.kde.org/mailman/listinfo/konsole-devel



-- 
Arkadiusz Miśkiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/



More information about the konsole-devel mailing list