Results 1 to 5 of 5

Thread: Konsole copying and tab character issues

  1. #1

    Default Konsole copying and tab character issues

    So whenever I copy some text from konsole, instead of having one tab character ('\t'). So my question is, is there a way to copy tabs from Konsole to clipboard preserving tab characters ('\t')?

    Big thanks in advance.

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,617
    Blog Entries
    3

    Default Re: Konsole copying and tab character issues

    I have never found a way of doing that.
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,278
    Blog Entries
    2

    Default Re: Konsole copying and tab character issues

    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
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,134

    Default Re: Konsole copying and tab character issues

    Quote Originally Posted by tsu2 View Post
    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.
    Last edited by Fraser_Bell; 18-Apr-2018 at 14:35. Reason: Fix broken quote tags
    Henk van Velden

  5. #5
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    2,555

    Unhappy Re: Konsole copying and tab character issues

    Two KDE Konsole windows -- edit with vim a test text -- two lines with 'noexpandtab'; two lines with 'expandtab' -- the tabs are there:
    Code:
     > 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:
    Code:
     > 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>:
    • Use "Kate" to open the text file with tabs; <Ctrl-A> then <Ctrl-C>.
    • Open the target file with vim, delete everything, 'A', <Ctrl-Shift-V>.

    Ah Hah!! the target file contains tabs …
    Code:
     > 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
     >

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •