Registered Member
|
I tried searching for the answer, but keywords like "KDE space tab" generate a lot of results. This forum seemed the best fit for my somewhat odd question.
It's probably simple. When using Konsole, and I have some quantity of text I've highlighted which includes tab characters, and I then attempt to paste that into Konsole, such as into a program like 'vi', the tab character gets turned into spaces. I need it to remain a tab character. I believe this is konsole rather than any program running in it as it turns a tab character into spaces just at the normal shell prompt as well. Can anyone tell me what to change and where, to get it to keep tabs as tabs, please? This would remove a a growing annoyance for me. If relevant, the platform is Kubuntu Lucid Lynx. Many thanks, H. |
Registered Member
|
I think the problem is nothing to do with Konsole and everything to do with BASH. man bash shows the definition: blank A space or tab - in other words BASH does not distinguish them. Maybe Konsole translates a tab into a fixed number of spaces but they are conceptually the same to BASH.
John Hudson, proud to be a member of KDE forums since 2008-Oct.
|
Manager
|
I did a little test where I copied a string created in Kate that included tabs and then pasted it into both a Konsole bash session and a vi session and tabs were retained in both cases.
In the Konsole session the paste initiated a auto completion response (?) of "Display all 4405 possibilities? (y or n)". In vi use of the backspace key indicated tabs were copied. Maybe the Klipper setting of "remove whitespaces when executing actions" is your problem. Or maybe in Kate (if that's what you're using) you have "Indent using" set to Spaces instead of Tabulators? |
Administrator
|
The problem likely occurs when copying from Vim in Konsole, that will result in Spaces not tabs ( at least in my testing )
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Yes. This is exactly where I'm having the problem. I found a reference to someone solving this elsewhere, but not actually how to do it. Thanks for your help, H. |
Registered Member
|
still no solution? I have the same problem, any TAB I copy-paste from Konsole (whether bash or vim) is turned into spaces.
(On a related note, when I paste a tab into bash, it's just removed, so 'fooTABbar' turns into 'foobar', but this does _not_ happen in vim... EDIT: of course, this happens because bash wants to expand on the tab. OK, so not related to the OP question, though it would be nice if Konsole could escape pasted tabs.) |
Administrator
|
Perhaps this is due to limitations in the PTY protocol, which don't allow Konsole to accurately determine the characters that are present? Have you filed a bug?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
I did some testing and found that both gnome-terminal and Terminal (from xfce) both display and allow selecting of tab characters as a single character (the desired behavior), whereas Konsole displays tab characters as the number of spaces needed to fill to the next tab stop (every 8 characters).
On the other hand, if you copy text from another source (e.g. kate) which contains tabs and paste into konsole, it properly inserts the tab characters (which are handled by whatever is currently managing stdin) Looks like the bug has already been reported (a couple of times): https://bugs.kde.org/show_bug.cgi?id=240929
airdrik, proud to be a member of KDE forums since 2008-Dec.
|
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell