1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? Copy & Paste without linebreak within TCMD

Discussion in 'Support' started by Alpengreis, Feb 16, 2016.

Tags:
  1. Alpengreis

    Joined:
    Jan 12, 2014
    Messages:
    229
    Likes Received:
    6
    After copy a long line in TCC, the text can be pasted without a linebreak.

    In TCMD I have always a linebreak after sign 128 ...

    So this is an example after paste from TCC ...
    Code:
    "C:\Program Files (x86)\F-Secure\Internet Security\apps\ComputerSecurity\Anti-Virus\fsav.exe" c:\ /all /rootkit /spyware /system /REPORT="d:\Temp_for_PRGs&Batches\FSAV-Crep.txt"

    and here from TCMD ...
    Code:
    "C:\Program Files (x86)\F-Secure\Internet Security\apps\ComputerSecurity\Anti-Virus\fsav.exe" c:\ /all /rootkit /spyware /syste
    m /REPORT="d:\Temp_for_PRGs&Batches\FSAV-Crep.txt"

    I know, the TCC window (not within TCMD) has the same bahaviour as a CMD window. The question is now, can I change this behaviour for TCMD (TCC within TCMD)?
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,809
    Likes Received:
    82
    If you hold down the Ctrl key when you are pasting, TCMD will append multiple lines in the clipboard to a single line in the tab window.
     
  3. Alpengreis

    Joined:
    Jan 12, 2014
    Messages:
    229
    Likes Received:
    6
    Thank you, Rex. I would like to use this copy & paste FROM TCMD (TCC tab) TO an editor (for example). (I have no problem for the vice versa way to insert a long line TO TCMD (TCC tab) anyway (even without <Ctrl>) (maybe I had misunderstood you, however ...)).

    I can use <Ctrl> while copy and paste then a single line to an editor. The problem with <Ctrl> is, I have then an additional UNDESIRED blank in the line as you can see here for example ...

    Code:
    "C:\Program Files (x86)\F-Secure\Internet Security\apps\ComputerSecurity\Anti-Virus\fsav.exe" /all /archive /hard /rootkit /s pyware /system /REPORT="d:\Temp_for_PRGs&Batches\FSAV-FULLrep.txt"
    The correct would be ...

    Code:
    "C:\Program Files (x86)\F-Secure\Internet Security\apps\ComputerSecurity\Anti-Virus\fsav.exe" /all /archive /hard /rootkit /spyware /system /REPORT="d:\Temp_for_PRGs&Batches\FSAV-FULLrep.txt"
    Look the word "spyware" ...

    Have you (another) idea about this?

    PS: I saw right know, the line break is not hardcoded after sign 128, it's related to the TCMD window width. So I can stretch the window, but this is not really a good solution for me because ...
    1) TCMD saves such changes.
    2) some lines are such long lines that even stretching would be not enough probably ...
     
    #3 Alpengreis, Feb 19, 2016
    Last edited: Feb 19, 2016
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,888
    Likes Received:
    30
    I don't see a problem with extra newlines when pressing <Ctrl> and then choosing Copy from the right click menu. But I do see spaces at the end of a line being lost. For example, if I select then Ctrl-Copy this
    upload_2016-2-19_13-20-27.png

    and paste it into an editor, I get only a single line, but the space between 72 and 73 has been lost.
    Code:
    69 70 71 7273 74 75 76 77
    Alpengreis, I can't duplicate your "space in the spyware" one. How did you do that?
     
  5. Alpengreis

    Joined:
    Jan 12, 2014
    Messages:
    229
    Likes Received:
    6
    Good question, vefatica ;-)

    I just paste it into my standard editor UltraEdit which is without active wrapping ... I will investigate it. Maybe it's really an editor thing HERE?!

    I'll report the result here soon!

    Thank you.

    EDIT: It's NOT the editor (have the same result even in Notepad), it's the copied text from TCMD (TCC tab) ... I post an complete example a bit later here ...

    EDIT2: This is a bit crazy, IT'S DIFFERENT, see the following examples:


    Example 1)
    test.btm

    c&p.JPG

    After copy&paste WITH <Ctrl> while copy, I have this result:
    Code:
    "C:\Program Files (x86)\F-Secure\Internet Security\apps\ComputerSecurity\Anti-Virus\fsav.exe" /all /archive /hard /r ootkit /spyware /system /REPORT="d:\Temp_for_PRGs&Batches\FSAV-FULLrep.txt"
    ONE space too much in word "rootkit"!


    Example 2)
    test2.btm

    c&p2.JPG

    After copy&paste WITH <Ctrl> while copy, I have this result:
    Code:
    rem "C:\Program Files (x86)\F-Secure\Internet Security\apps\ComputerSecurity\Anti-Virus\fsav.exe" /all /archive /hard/rootkit /spyware /system /REPORT="d:\Temp_for_PRGs&Batches\FSAV-FULLrep.txt"
    ONE space too less before "/rootkit"!


    "Example" 3)

    Not a demonstrated example here (because not tested (yet)). Just for information: it could be possible to have even a result which is correct, IF THE BLANK IS AT A CORRECT POSITION (where a blank must be) ...
     

    Attached Files:

    #5 Alpengreis, Feb 19, 2016
    Last edited: Feb 19, 2016
  6. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,888
    Likes Received:
    30
    I still can't reproduce your example 1. Your example 2 seems to be the same problem as in my example.
     
  7. Alpengreis

    Joined:
    Jan 12, 2014
    Messages:
    229
    Likes Received:
    6
    Maybe you have different sizes (font, window)?

    If I have enough time yet later, I will try with another font (which you can select too, because I have a non-standard one I believe (Source Code Pro)) ...
     
  8. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,888
    Likes Received:
    30
    Mine's a bit unusual, Andale Mono Bold 10.

    You might also try adjusting the width of the TCMD tab ... just a tiny bit, not enough to gain or lose a character.
     
  9. Alpengreis

    Joined:
    Jan 12, 2014
    Messages:
    229
    Likes Received:
    6
    At least with my font "Source Code Pro 14", adjust of window width makes no different. As soon as a letter is truncated and this letter is integrated in a word (not the last position of a word) - right after this letter is always a blank then after paste.

    Hint: to reproduce example 1, it is necessary to copy ONLY the text (begins with " sign, do NOT copy the blanks before (else here the line is correct too). Then mark, hold <Ctrl> choose Copy and paste it externally ...
     
    #9 Alpengreis, Feb 21, 2016
    Last edited: Feb 27, 2016
  10. Alpengreis

    Joined:
    Jan 12, 2014
    Messages:
    229
    Likes Received:
    6
    @Rex

    Have you here a solution/workaround to avoid the space problem?
     
  11. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,809
    Likes Received:
    82
    TCMD will always append a space when concatenating lines.
     
  12. Alpengreis

    Joined:
    Jan 12, 2014
    Messages:
    229
    Likes Received:
    6
    Unfortunately NOT always, please see my example 2 above. in such a case (I assume because it is a blank at end of line 1 already), the space is removed after a CTRL + Copy ...

    This is a bit ... hmm ... ugly, because sometimes it's a blank too much, sometimes one too less.

    Well, it's not a big thing and I can use a real TCC window for such things. OR I decide to use NOT the copy with Ctrl and put the line manually together. Nevertheless it would be better, if the "effect" would be ALWAYS the same ... But I can imagine that the "copy with Ctrl effect" is by design anyway.

    Enjoy your weekend!
     
  13. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,809
    Likes Received:
    82
    Unfortunately, still WAD.

    If you have a wrapped line, it is impossible for TCMD to determine if the line ended exactly at the right column, or if it was wrapped to the next line. Console window output doesn't have any line endings, so TCMD has to assume that the rightmost non-space character is the last character on the line.

    Console windows also don't have a null / "non-character" -- they're initialized to all spaces + the default attribute. TCMD therefore can't assume that a trailing space is anything other than an EOL equivalent.
     
  14. Alpengreis

    Joined:
    Jan 12, 2014
    Messages:
    229
    Likes Received:
    6
    Okay, thank your for detailed explanation!
     

Share This Page