So whenever I copy some text from konsole, instead of having one tab character (’ ‘). So my question is, is there a way to copy tabs from Konsole to clipboard preserving tab characters (’ ')?
Big thanks in advance.
So whenever I copy some text from konsole, instead of having one tab character (’ ‘). So my question is, is there a way to copy tabs from Konsole to clipboard preserving tab characters (’ ')?
Big thanks in advance.
I have never found a way of doing that.
I’m going to guess that what you want to do may rely in part to whatever text editor you’re using… because of course the first trick is to insert the tab (If in a bare Konsole, you’ll have to re-map the tab key).
In any case,
I have no problems copying white space like individual spaces… I just ran a test and as long as I precede the spaces with an acceptable character, there is no problem.
And,
Another example is for example “systemctl status” and zypper stdouts… Those contain formatted text including tabs which I’ve always been able to copy and paste preserving the formatting.
TSU
He does not complain about the formatting lost, he complains about the tabs lost. They being replaced by the needed number of blank spaces to emulate the tab stops on positions 8, 16, …
I experience the same. When I copy from one konsole to the other (e.g.both have a vi of some file open) and I copy some lines with tab characters from one into the other file, it looks fine, but there are no tabs, but 1, 2, 3, 4, 5, 6 or 7 blank spaces according to need.
Like the OP here I find this irritating. autistic as I am, I want a neat file with tabs on those places, thus I have to correct that after the copy/paste.
Two KDE Konsole windows – edit with vim a test text – two lines with ‘noexpandtab’; two lines with ‘expandtab’ – the tabs are there:
> od -a TabTest
0000000 # nl nl . ht . sp < T a b > sp ( n o
0000020 e x p a n d t a b ) nl . ht . sp <
0000040 T a b > sp ( n o e x p a n d t a
0000060 b ) nl nl . sp sp sp sp sp sp sp . sp < T
0000100 a b > sp ( e x p a n d t a b ) nl
0000120 . sp sp sp sp sp sp sp . sp < T a b > sp
0000140 ( e x p a n d t a b ) nl nl # nl
0000157
>
Cat the test file and in the other window “vim” a new test file; “set noexpandtab”; paste the concatenated text into the new file:
> od -a Target_TabTest-copy
0000000 # nl nl . sp sp sp sp sp sp sp . sp < T a
0000020 b > sp ( n o e x p a n d t a b )
0000040 nl . sp sp sp sp sp sp sp . sp < T a b >
0000060 sp ( n o e x p a n d t a b ) nl nl
0000100 . sp sp sp sp sp sp sp . sp < T a b > sp
0000120 ( e x p a n d t a b ) nl . sp sp sp
0000140 sp sp sp sp . sp < T a b > sp ( e x p
0000160 a n d t a b ) nl nl # nl
0000173
>
The tabs have been expanded …
Check the “cat” man page – “cat --show-tabs” doesn’t help …
Search “the Net” … Ah Hah!!! : https://forum.kde.org/viewtopic.php?t=89574:
Ah Hah!! the target file contains tabs … >:)
> od -a Target_TabTest-copy
0000000 # nl nl . ht . sp < T a b > sp ( n o
0000020 e x p a n d t a b ) nl . ht . sp <
0000040 T a b > sp ( n o e x p a n d t a
0000060 b ) nl nl . sp sp sp sp sp sp sp . sp < T
0000100 a b > sp ( e x p a n d t a b ) nl
0000120 . sp sp sp sp sp sp sp . sp < T a b > sp
0000140 ( e x p a n d t a b ) nl nl # nl
0000157
>