Pasting text into terminal editors always pastes into a single line on Ubuntu for Windows (10)












4















I am trying to paste from the windows system clipboard into a terminal text editor like vim (or its clipboard and xterm-clipboard allowing variants like vim-gtx), nano or emacs to no avail.



I am mainly attempting it with vim-gtx since vim is my favorite editor -> but no matter what method I try, whether it is:




  • Using :set paste and pasting with Ctrl-v,Shift-ctrl-v (this is the only method which pastes any clipboard content at all)

  • Pasting with "*p or "+p (doesn't paste)

  • Copying input to clip.exe (have tried xclip but this utility doesn't seem to work on WSL), and then pasting into vim.


AS mentioned above, pasting from the clipboard only seems to work when pressing Ctrl-v in insert mode (Shift-Ctrl-v inserts a '^', and "*p and "+p inserts an 'i' character or '^?'), and the pasted output always pastes onto a single line.



For example, a section of the default .bashrc file copied from VSCode:



# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi


Will paste as the following into a terminal text editor:



# enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if ! shopt -oq posix; then   if [ -f /usr/share/bash-completion/bash_completion ]; then     . /usr/share/bash-completion/bash_completion   elif [ -f /etc/bash_completion ]; then     . /etc/bash_completion   fi fi


If making EOL characters visible, then a $ appears just after the final character.
This problem occurs no matter which editor is used, from where the text is copied from, and no matter which pasting system is used (if the pasting is successful at all).



To sum up:




  • Ctrl-v in vim is the only way to paste anything, but pasting occurs
    on a single line only


  • "*p / "+p in vim does not paste as expected (but works in vim via git-for-windows, see note below)


  • I'm unsure of how to paste from system clipboard into nano and emacs (ordinary pasting and piping output to windows clip and then pasting doesn't paste anything in these two programs - I can only paste after yanking/copying internally).

  • So, it could be a problem (with all) varieties of vim on Ubuntu for Windows.


Thanks



Important Note: -When pasting with "*p on vim via git-for-windows (instead of Ubuntu bash), it pastes correctly (with new lines). But Vim (vim-gtx, or ppa version) via Ubuntu is unable to paste properly with "*p - it's looking to perhaps be a problem with vim being ported to










share|improve this question




















  • 3





    It could have something to do with how Windows linebreaks are different from UNIX linebreaks. What you could try is downloading Sublime Text Editor, pasting the text into there, then going to View-->Line Endings-->UNIX and pasting the text from Sublime into vim.

    – TheWanderer
    Jul 5 '17 at 12:23











  • Thanks for the input! I've tried this and it doesn't make a difference. I've made an edit to my post. I realised that pasting works with "*p via vim on git-for-windows, but not on Ubuntu for Windows. It's perhaps looking to be a problem with (all?) varieties of vim on Ubuntu for Windows? Do you perchance know of a way to paste from system clipboard on nano/emacs? (I thought I was doing this before but perhaps I'm doing it wrong) - if I can rule out one of these editors and its pasting options, then vim can be ruled out as being the problem!

    – Samuel G
    Jul 5 '17 at 13:11













  • Right-clicking is how you paste into a CMD window. I just tried it now in nano and it worked for a URL. It also worked when I copied your example text and pasted it. Line breaks were kept.

    – TheWanderer
    Jul 5 '17 at 13:15











  • I've just tried it in nano - and it works. Thank you. The problem then, seems to be vim

    – Samuel G
    Jul 5 '17 at 13:19











  • I guess so. If nano works for you though, that's definitely good.

    – TheWanderer
    Jul 5 '17 at 13:20
















4















I am trying to paste from the windows system clipboard into a terminal text editor like vim (or its clipboard and xterm-clipboard allowing variants like vim-gtx), nano or emacs to no avail.



I am mainly attempting it with vim-gtx since vim is my favorite editor -> but no matter what method I try, whether it is:




  • Using :set paste and pasting with Ctrl-v,Shift-ctrl-v (this is the only method which pastes any clipboard content at all)

  • Pasting with "*p or "+p (doesn't paste)

  • Copying input to clip.exe (have tried xclip but this utility doesn't seem to work on WSL), and then pasting into vim.


AS mentioned above, pasting from the clipboard only seems to work when pressing Ctrl-v in insert mode (Shift-Ctrl-v inserts a '^', and "*p and "+p inserts an 'i' character or '^?'), and the pasted output always pastes onto a single line.



For example, a section of the default .bashrc file copied from VSCode:



# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi


Will paste as the following into a terminal text editor:



# enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if ! shopt -oq posix; then   if [ -f /usr/share/bash-completion/bash_completion ]; then     . /usr/share/bash-completion/bash_completion   elif [ -f /etc/bash_completion ]; then     . /etc/bash_completion   fi fi


If making EOL characters visible, then a $ appears just after the final character.
This problem occurs no matter which editor is used, from where the text is copied from, and no matter which pasting system is used (if the pasting is successful at all).



To sum up:




  • Ctrl-v in vim is the only way to paste anything, but pasting occurs
    on a single line only


  • "*p / "+p in vim does not paste as expected (but works in vim via git-for-windows, see note below)


  • I'm unsure of how to paste from system clipboard into nano and emacs (ordinary pasting and piping output to windows clip and then pasting doesn't paste anything in these two programs - I can only paste after yanking/copying internally).

  • So, it could be a problem (with all) varieties of vim on Ubuntu for Windows.


Thanks



Important Note: -When pasting with "*p on vim via git-for-windows (instead of Ubuntu bash), it pastes correctly (with new lines). But Vim (vim-gtx, or ppa version) via Ubuntu is unable to paste properly with "*p - it's looking to perhaps be a problem with vim being ported to










share|improve this question




















  • 3





    It could have something to do with how Windows linebreaks are different from UNIX linebreaks. What you could try is downloading Sublime Text Editor, pasting the text into there, then going to View-->Line Endings-->UNIX and pasting the text from Sublime into vim.

    – TheWanderer
    Jul 5 '17 at 12:23











  • Thanks for the input! I've tried this and it doesn't make a difference. I've made an edit to my post. I realised that pasting works with "*p via vim on git-for-windows, but not on Ubuntu for Windows. It's perhaps looking to be a problem with (all?) varieties of vim on Ubuntu for Windows? Do you perchance know of a way to paste from system clipboard on nano/emacs? (I thought I was doing this before but perhaps I'm doing it wrong) - if I can rule out one of these editors and its pasting options, then vim can be ruled out as being the problem!

    – Samuel G
    Jul 5 '17 at 13:11













  • Right-clicking is how you paste into a CMD window. I just tried it now in nano and it worked for a URL. It also worked when I copied your example text and pasted it. Line breaks were kept.

    – TheWanderer
    Jul 5 '17 at 13:15











  • I've just tried it in nano - and it works. Thank you. The problem then, seems to be vim

    – Samuel G
    Jul 5 '17 at 13:19











  • I guess so. If nano works for you though, that's definitely good.

    – TheWanderer
    Jul 5 '17 at 13:20














4












4








4








I am trying to paste from the windows system clipboard into a terminal text editor like vim (or its clipboard and xterm-clipboard allowing variants like vim-gtx), nano or emacs to no avail.



I am mainly attempting it with vim-gtx since vim is my favorite editor -> but no matter what method I try, whether it is:




  • Using :set paste and pasting with Ctrl-v,Shift-ctrl-v (this is the only method which pastes any clipboard content at all)

  • Pasting with "*p or "+p (doesn't paste)

  • Copying input to clip.exe (have tried xclip but this utility doesn't seem to work on WSL), and then pasting into vim.


AS mentioned above, pasting from the clipboard only seems to work when pressing Ctrl-v in insert mode (Shift-Ctrl-v inserts a '^', and "*p and "+p inserts an 'i' character or '^?'), and the pasted output always pastes onto a single line.



For example, a section of the default .bashrc file copied from VSCode:



# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi


Will paste as the following into a terminal text editor:



# enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if ! shopt -oq posix; then   if [ -f /usr/share/bash-completion/bash_completion ]; then     . /usr/share/bash-completion/bash_completion   elif [ -f /etc/bash_completion ]; then     . /etc/bash_completion   fi fi


If making EOL characters visible, then a $ appears just after the final character.
This problem occurs no matter which editor is used, from where the text is copied from, and no matter which pasting system is used (if the pasting is successful at all).



To sum up:




  • Ctrl-v in vim is the only way to paste anything, but pasting occurs
    on a single line only


  • "*p / "+p in vim does not paste as expected (but works in vim via git-for-windows, see note below)


  • I'm unsure of how to paste from system clipboard into nano and emacs (ordinary pasting and piping output to windows clip and then pasting doesn't paste anything in these two programs - I can only paste after yanking/copying internally).

  • So, it could be a problem (with all) varieties of vim on Ubuntu for Windows.


Thanks



Important Note: -When pasting with "*p on vim via git-for-windows (instead of Ubuntu bash), it pastes correctly (with new lines). But Vim (vim-gtx, or ppa version) via Ubuntu is unable to paste properly with "*p - it's looking to perhaps be a problem with vim being ported to










share|improve this question
















I am trying to paste from the windows system clipboard into a terminal text editor like vim (or its clipboard and xterm-clipboard allowing variants like vim-gtx), nano or emacs to no avail.



I am mainly attempting it with vim-gtx since vim is my favorite editor -> but no matter what method I try, whether it is:




  • Using :set paste and pasting with Ctrl-v,Shift-ctrl-v (this is the only method which pastes any clipboard content at all)

  • Pasting with "*p or "+p (doesn't paste)

  • Copying input to clip.exe (have tried xclip but this utility doesn't seem to work on WSL), and then pasting into vim.


AS mentioned above, pasting from the clipboard only seems to work when pressing Ctrl-v in insert mode (Shift-Ctrl-v inserts a '^', and "*p and "+p inserts an 'i' character or '^?'), and the pasted output always pastes onto a single line.



For example, a section of the default .bashrc file copied from VSCode:



# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi


Will paste as the following into a terminal text editor:



# enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if ! shopt -oq posix; then   if [ -f /usr/share/bash-completion/bash_completion ]; then     . /usr/share/bash-completion/bash_completion   elif [ -f /etc/bash_completion ]; then     . /etc/bash_completion   fi fi


If making EOL characters visible, then a $ appears just after the final character.
This problem occurs no matter which editor is used, from where the text is copied from, and no matter which pasting system is used (if the pasting is successful at all).



To sum up:




  • Ctrl-v in vim is the only way to paste anything, but pasting occurs
    on a single line only


  • "*p / "+p in vim does not paste as expected (but works in vim via git-for-windows, see note below)


  • I'm unsure of how to paste from system clipboard into nano and emacs (ordinary pasting and piping output to windows clip and then pasting doesn't paste anything in these two programs - I can only paste after yanking/copying internally).

  • So, it could be a problem (with all) varieties of vim on Ubuntu for Windows.


Thanks



Important Note: -When pasting with "*p on vim via git-for-windows (instead of Ubuntu bash), it pastes correctly (with new lines). But Vim (vim-gtx, or ppa version) via Ubuntu is unable to paste properly with "*p - it's looking to perhaps be a problem with vim being ported to







command-line vim clipboard windows-subsystem-for-linux






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 10 '17 at 10:05









muru

1




1










asked Jul 5 '17 at 11:13









Samuel GSamuel G

215




215








  • 3





    It could have something to do with how Windows linebreaks are different from UNIX linebreaks. What you could try is downloading Sublime Text Editor, pasting the text into there, then going to View-->Line Endings-->UNIX and pasting the text from Sublime into vim.

    – TheWanderer
    Jul 5 '17 at 12:23











  • Thanks for the input! I've tried this and it doesn't make a difference. I've made an edit to my post. I realised that pasting works with "*p via vim on git-for-windows, but not on Ubuntu for Windows. It's perhaps looking to be a problem with (all?) varieties of vim on Ubuntu for Windows? Do you perchance know of a way to paste from system clipboard on nano/emacs? (I thought I was doing this before but perhaps I'm doing it wrong) - if I can rule out one of these editors and its pasting options, then vim can be ruled out as being the problem!

    – Samuel G
    Jul 5 '17 at 13:11













  • Right-clicking is how you paste into a CMD window. I just tried it now in nano and it worked for a URL. It also worked when I copied your example text and pasted it. Line breaks were kept.

    – TheWanderer
    Jul 5 '17 at 13:15











  • I've just tried it in nano - and it works. Thank you. The problem then, seems to be vim

    – Samuel G
    Jul 5 '17 at 13:19











  • I guess so. If nano works for you though, that's definitely good.

    – TheWanderer
    Jul 5 '17 at 13:20














  • 3





    It could have something to do with how Windows linebreaks are different from UNIX linebreaks. What you could try is downloading Sublime Text Editor, pasting the text into there, then going to View-->Line Endings-->UNIX and pasting the text from Sublime into vim.

    – TheWanderer
    Jul 5 '17 at 12:23











  • Thanks for the input! I've tried this and it doesn't make a difference. I've made an edit to my post. I realised that pasting works with "*p via vim on git-for-windows, but not on Ubuntu for Windows. It's perhaps looking to be a problem with (all?) varieties of vim on Ubuntu for Windows? Do you perchance know of a way to paste from system clipboard on nano/emacs? (I thought I was doing this before but perhaps I'm doing it wrong) - if I can rule out one of these editors and its pasting options, then vim can be ruled out as being the problem!

    – Samuel G
    Jul 5 '17 at 13:11













  • Right-clicking is how you paste into a CMD window. I just tried it now in nano and it worked for a URL. It also worked when I copied your example text and pasted it. Line breaks were kept.

    – TheWanderer
    Jul 5 '17 at 13:15











  • I've just tried it in nano - and it works. Thank you. The problem then, seems to be vim

    – Samuel G
    Jul 5 '17 at 13:19











  • I guess so. If nano works for you though, that's definitely good.

    – TheWanderer
    Jul 5 '17 at 13:20








3




3





It could have something to do with how Windows linebreaks are different from UNIX linebreaks. What you could try is downloading Sublime Text Editor, pasting the text into there, then going to View-->Line Endings-->UNIX and pasting the text from Sublime into vim.

– TheWanderer
Jul 5 '17 at 12:23





It could have something to do with how Windows linebreaks are different from UNIX linebreaks. What you could try is downloading Sublime Text Editor, pasting the text into there, then going to View-->Line Endings-->UNIX and pasting the text from Sublime into vim.

– TheWanderer
Jul 5 '17 at 12:23













Thanks for the input! I've tried this and it doesn't make a difference. I've made an edit to my post. I realised that pasting works with "*p via vim on git-for-windows, but not on Ubuntu for Windows. It's perhaps looking to be a problem with (all?) varieties of vim on Ubuntu for Windows? Do you perchance know of a way to paste from system clipboard on nano/emacs? (I thought I was doing this before but perhaps I'm doing it wrong) - if I can rule out one of these editors and its pasting options, then vim can be ruled out as being the problem!

– Samuel G
Jul 5 '17 at 13:11







Thanks for the input! I've tried this and it doesn't make a difference. I've made an edit to my post. I realised that pasting works with "*p via vim on git-for-windows, but not on Ubuntu for Windows. It's perhaps looking to be a problem with (all?) varieties of vim on Ubuntu for Windows? Do you perchance know of a way to paste from system clipboard on nano/emacs? (I thought I was doing this before but perhaps I'm doing it wrong) - if I can rule out one of these editors and its pasting options, then vim can be ruled out as being the problem!

– Samuel G
Jul 5 '17 at 13:11















Right-clicking is how you paste into a CMD window. I just tried it now in nano and it worked for a URL. It also worked when I copied your example text and pasted it. Line breaks were kept.

– TheWanderer
Jul 5 '17 at 13:15





Right-clicking is how you paste into a CMD window. I just tried it now in nano and it worked for a URL. It also worked when I copied your example text and pasted it. Line breaks were kept.

– TheWanderer
Jul 5 '17 at 13:15













I've just tried it in nano - and it works. Thank you. The problem then, seems to be vim

– Samuel G
Jul 5 '17 at 13:19





I've just tried it in nano - and it works. Thank you. The problem then, seems to be vim

– Samuel G
Jul 5 '17 at 13:19













I guess so. If nano works for you though, that's definitely good.

– TheWanderer
Jul 5 '17 at 13:20





I guess so. If nano works for you though, that's definitely good.

– TheWanderer
Jul 5 '17 at 13:20










3 Answers
3






active

oldest

votes


















0














Try this chain: Control + R then Shift + =






share|improve this answer































    0














    This question was written in June 2017 and many have requested WSL copy and paste support. In response Microsoft released an update in April 2018: Copy and Paste arrives for Linux/WSL Consoles:




    As of Windows 10 Insider build #17643, you can copy/paste text from/to
    Linux/WSL Consoles!!!



    We know that this is a feature MANY of you have been waiting for - our
    sincerest thanks for your patience & continued support while we
    untangled the Console's internals, allowing us to implement this
    feature.



    To ensure that we don't break any existing behaviors, you'll need to
    enable the "Use Ctrl+Shift+C/V as Copy/Paste" option in the Console
    "Options" properties page.




    Note: You will need the Windows September 2018 update to use the new feature.






    share|improve this answer































      0














      Define Bash variable $EDITOR to any of choice i.e.



            export $EDITOR=/usr/bin/nano 


      Then use Ctrl-x Ctrl-e that launch nano. Then you could paste multiline selection after save you return to shell with command filled from edit.
      #
      update
      just after a while, want to add that the trick with nano is based on new capability of WSL gained as mentioned with one 2018 update.






      share|improve this answer

























        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "89"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f932224%2fpasting-text-into-terminal-editors-always-pastes-into-a-single-line-on-ubuntu-fo%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        0














        Try this chain: Control + R then Shift + =






        share|improve this answer




























          0














          Try this chain: Control + R then Shift + =






          share|improve this answer


























            0












            0








            0







            Try this chain: Control + R then Shift + =






            share|improve this answer













            Try this chain: Control + R then Shift + =







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 30 '18 at 7:37









            xliivxliiv

            2001210




            2001210

























                0














                This question was written in June 2017 and many have requested WSL copy and paste support. In response Microsoft released an update in April 2018: Copy and Paste arrives for Linux/WSL Consoles:




                As of Windows 10 Insider build #17643, you can copy/paste text from/to
                Linux/WSL Consoles!!!



                We know that this is a feature MANY of you have been waiting for - our
                sincerest thanks for your patience & continued support while we
                untangled the Console's internals, allowing us to implement this
                feature.



                To ensure that we don't break any existing behaviors, you'll need to
                enable the "Use Ctrl+Shift+C/V as Copy/Paste" option in the Console
                "Options" properties page.




                Note: You will need the Windows September 2018 update to use the new feature.






                share|improve this answer




























                  0














                  This question was written in June 2017 and many have requested WSL copy and paste support. In response Microsoft released an update in April 2018: Copy and Paste arrives for Linux/WSL Consoles:




                  As of Windows 10 Insider build #17643, you can copy/paste text from/to
                  Linux/WSL Consoles!!!



                  We know that this is a feature MANY of you have been waiting for - our
                  sincerest thanks for your patience & continued support while we
                  untangled the Console's internals, allowing us to implement this
                  feature.



                  To ensure that we don't break any existing behaviors, you'll need to
                  enable the "Use Ctrl+Shift+C/V as Copy/Paste" option in the Console
                  "Options" properties page.




                  Note: You will need the Windows September 2018 update to use the new feature.






                  share|improve this answer


























                    0












                    0








                    0







                    This question was written in June 2017 and many have requested WSL copy and paste support. In response Microsoft released an update in April 2018: Copy and Paste arrives for Linux/WSL Consoles:




                    As of Windows 10 Insider build #17643, you can copy/paste text from/to
                    Linux/WSL Consoles!!!



                    We know that this is a feature MANY of you have been waiting for - our
                    sincerest thanks for your patience & continued support while we
                    untangled the Console's internals, allowing us to implement this
                    feature.



                    To ensure that we don't break any existing behaviors, you'll need to
                    enable the "Use Ctrl+Shift+C/V as Copy/Paste" option in the Console
                    "Options" properties page.




                    Note: You will need the Windows September 2018 update to use the new feature.






                    share|improve this answer













                    This question was written in June 2017 and many have requested WSL copy and paste support. In response Microsoft released an update in April 2018: Copy and Paste arrives for Linux/WSL Consoles:




                    As of Windows 10 Insider build #17643, you can copy/paste text from/to
                    Linux/WSL Consoles!!!



                    We know that this is a feature MANY of you have been waiting for - our
                    sincerest thanks for your patience & continued support while we
                    untangled the Console's internals, allowing us to implement this
                    feature.



                    To ensure that we don't break any existing behaviors, you'll need to
                    enable the "Use Ctrl+Shift+C/V as Copy/Paste" option in the Console
                    "Options" properties page.




                    Note: You will need the Windows September 2018 update to use the new feature.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 26 '18 at 21:49









                    WinEunuuchs2UnixWinEunuuchs2Unix

                    44.7k1080170




                    44.7k1080170























                        0














                        Define Bash variable $EDITOR to any of choice i.e.



                              export $EDITOR=/usr/bin/nano 


                        Then use Ctrl-x Ctrl-e that launch nano. Then you could paste multiline selection after save you return to shell with command filled from edit.
                        #
                        update
                        just after a while, want to add that the trick with nano is based on new capability of WSL gained as mentioned with one 2018 update.






                        share|improve this answer






























                          0














                          Define Bash variable $EDITOR to any of choice i.e.



                                export $EDITOR=/usr/bin/nano 


                          Then use Ctrl-x Ctrl-e that launch nano. Then you could paste multiline selection after save you return to shell with command filled from edit.
                          #
                          update
                          just after a while, want to add that the trick with nano is based on new capability of WSL gained as mentioned with one 2018 update.






                          share|improve this answer




























                            0












                            0








                            0







                            Define Bash variable $EDITOR to any of choice i.e.



                                  export $EDITOR=/usr/bin/nano 


                            Then use Ctrl-x Ctrl-e that launch nano. Then you could paste multiline selection after save you return to shell with command filled from edit.
                            #
                            update
                            just after a while, want to add that the trick with nano is based on new capability of WSL gained as mentioned with one 2018 update.






                            share|improve this answer















                            Define Bash variable $EDITOR to any of choice i.e.



                                  export $EDITOR=/usr/bin/nano 


                            Then use Ctrl-x Ctrl-e that launch nano. Then you could paste multiline selection after save you return to shell with command filled from edit.
                            #
                            update
                            just after a while, want to add that the trick with nano is based on new capability of WSL gained as mentioned with one 2018 update.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Jan 10 at 21:08

























                            answered Dec 26 '18 at 19:31









                            YurijYurij

                            9010




                            9010






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Ask Ubuntu!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f932224%2fpasting-text-into-terminal-editors-always-pastes-into-a-single-line-on-ubuntu-fo%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Quarter-circle Tiles

                                build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

                                Mont Emei