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

Robert Knight robertknight at gmail.com
Sat Aug 2 19:13:43 UTC 2008


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.  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.
You're welcome to look at the KDE 3 or KDE 4 code though to find
out what is involved.

The basic pipeline is in the terminal (using KDE 4 class names is):

1.  Data arrives via the Pty class (Pty.cpp)
2.  The Vt102Emulation class then processes each character in the
receiveChar() method
3.  Once the token has been classified (either as a character to print
on screen or as a command sequence) then the tau() method
calls Screen::ShowCharacter() to display it or updates the screen in
some other way for command sequences (eg. changing the
foreground/background colors)
4.  Screen::ShowCharacter() calls konsole_wcwidth() to find out how
many columns the character should occupy, it then inserts the
character into the first column and puts null characters in the other
columns which are also occupied by that character.

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.
2.  Change konsole_wcwidth() to return 4 or 8 as the width of a tab character.

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
>
>


More information about the konsole-devel mailing list