#174 Preserve new-lines in paste ...

closed-fixed
nobody
None
9
2010-11-03
2007-06-06
No

When I copy-paste text into console, all the newlines get removed ... which is to say, if I have:

mkdir foo
cd foo
echo "barrio" > bar.txt
dir

and I copy paste that into console, I would expect it to execute as four lines of commands, and instead it mushes them into one line ...

mkdir foocd fooecho "barrio" > bar.txtdir

Now, that wouldn't be so bad if it at least had the presence of mind to insert "; " characters where the line breaks are, so I could still execute it, but as-is it means I basically can't paste into the console except very carefully one line at a time.

I have an autohotkey script to "fix" that temporarily ... it disregards the user's settings for paste hotkeys (that is, the paste keys are hardcoded in this little script as Ctrl+v or the mouse right-click). And technically, it doesn't paste at all, it simulates keyboard input.

#IfWinActive Console2
RButton::
^v::
Loop, parse, clipboard,`n,`r
{
SendInput {RAW}%A_LoopField%`n
}
#IfWinActive

Discussion

    • priority: 5 --> 9
     
  • Logged In: YES
    user_id=16767
    Originator: NO

    Which Console2 build are you using? This problem has been fixed. Please download the latest build.

    Console2 emulates ENTER keypress for each CR, CRLF or LF combination when pasting.

     
  • Logged In: NO

    I have the same problem, using 2.00.131

     
  • Logged In: YES
    user_id=16767
    Originator: NO

    Have you tried it with b131 and its default configuration?

     
  • Kirill
    Kirill
    2007-09-16

    Logged In: YES
    user_id=1664805
    Originator: NO

    It did not work for me either until I invented the patch 1795628.

     
  • Kirill
    Kirill
    2007-09-16

    Logged In: YES
    user_id=1664805
    Originator: NO

    Sorry again (today is not my day), I'm using build 132.

     
  • Rick Sayre
    Rick Sayre
    2008-04-24

    Logged In: YES
    user_id=1487639
    Originator: NO

    As of build .133, this is now broken for me, whereas previously
    [including build .132] paste of new-lines worked for BOTH
    key-bindings and poking the "paste" button.

    As of build .133, poking the "paste" button works, but the
    "Paste" keybinding does not.

     
  • Rick Sayre
    Rick Sayre
    2008-04-24

    Logged In: YES
    user_id=1487639
    Originator: NO

    ...to be more specific, i've tested this from build 133 to
    build 139, and it remains as i reported - newlines in paste
    work for the paste "button", but fail for a keybinding.

     
  • Logged In: NO

    I use the newest .139 build and have problems with not preserving new lines in paste operation... Essentialy, when I paste, I get randomly removed some of the new lines characters. It happens only when line length is small.

    For example, when i paste the following:
    aaaaaaaaaaaaaaaaaaaaaaaaaaa
    /
    bbbbbbbbbbbbbbbbbbbbbbbbbbb

    I very often (8 times out of 10) get the following pasted:
    aaaaaaaaaaaaaaaaaaaaaaaaaaa/
    bbbbbbbbbbbbbbbbbbbbbbbbbbb

     
  • Logged In: NO

    One remark about my previous comment: this situation occurs even when I use paste button (when using hotkey - of course all new lines characters just get removed, just as people have been reporting...)

     
  • Logged In: YES
    user_id=16767
    Originator: NO

    Console now uses Windows console's Paste command to paste text - pasting will now behave as it behaves in the regular console windows.

    This will be available in the next build.

     
  • Logged In: NO

    The paste command is working like a charm now (in the newest 140 build) - thank you!
    Christopher from Poland

     
  • Athena
    Athena
    2010-10-29

    Something not included in the original report -- HOW is the original user copying the text?

    From 'where'? A text editor?

    What text editor?

    Copying from console and pasting to console works fine for me (v2.0.146 32bit).

    That said, I know from experience in windowing systems 'in general' that if you select and copy from some text-editors -- the newlines may not be preserved.

    A bigger problem (in my experience) is getting Tab's to copy. Most of the time, if you copy/paste from a text window showing a file w/tabs in the text, when you paste -- the tabs won't be preserved. Most GUI editors will preserve them -- especially when you use the editor's built-in copy/paste functions from the menu, but these days, most GUI handle copy paste using mouse and keyboard shortcuts just fine.

    Anyway -- where did you copy from?

    IS this still a bug?

     
    • status: open --> closed-fixed