Byobu / Tmux copy whole line

Multi tool use
Multi tool use












1















I use byobu in tmux mode. In screen I can do this:



Ctrl+a [, move to line, Y, Ctrl+a ]


"Y" copys the whole line into the clipboard. I am looking to something similar in byobu in tmux mode. The only thing I found is:



Ctrl+a/b (depends on your setting) + [, move to line, 0, space, $, enter, Ctrl+a/b + ]


But I feel like that is a lot of hard to reach keystrokes, Y is much easier.










share|improve this question





























    1















    I use byobu in tmux mode. In screen I can do this:



    Ctrl+a [, move to line, Y, Ctrl+a ]


    "Y" copys the whole line into the clipboard. I am looking to something similar in byobu in tmux mode. The only thing I found is:



    Ctrl+a/b (depends on your setting) + [, move to line, 0, space, $, enter, Ctrl+a/b + ]


    But I feel like that is a lot of hard to reach keystrokes, Y is much easier.










    share|improve this question



























      1












      1








      1


      1






      I use byobu in tmux mode. In screen I can do this:



      Ctrl+a [, move to line, Y, Ctrl+a ]


      "Y" copys the whole line into the clipboard. I am looking to something similar in byobu in tmux mode. The only thing I found is:



      Ctrl+a/b (depends on your setting) + [, move to line, 0, space, $, enter, Ctrl+a/b + ]


      But I feel like that is a lot of hard to reach keystrokes, Y is much easier.










      share|improve this question
















      I use byobu in tmux mode. In screen I can do this:



      Ctrl+a [, move to line, Y, Ctrl+a ]


      "Y" copys the whole line into the clipboard. I am looking to something similar in byobu in tmux mode. The only thing I found is:



      Ctrl+a/b (depends on your setting) + [, move to line, 0, space, $, enter, Ctrl+a/b + ]


      But I feel like that is a lot of hard to reach keystrokes, Y is much easier.







      tmux gnu-screen byobu






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 2 '17 at 16:10









      terdon

      129k32253428




      129k32253428










      asked Jul 25 '17 at 14:09









      VedaVeda

      1757




      1757






















          3 Answers
          3






          active

          oldest

          votes


















          0














          A bit of an improvement: do space, V, enter instead of 0, space, $, enter. A single V is a lot easier to type than a 0 and a $. V is equivalent to vim's "do visual mode select of entire line" command.



          I can't speak to byobu directly but since it's just fronting tmux, you could also bind a key to all this in native tmux. Something like this:



          bind-key -r -T copy-mode-vi Y send-keys -X begin-selection ; send-keys -X select-line ; send-keys -X copy-selection


          Then you just enter copy mode, go to the line you want to copy, press Y then Enter. The line will now be in the paste buffer. (While that's a bit long and ugly it does work for me.)



          Edit: Tested with tmux 2.4






          share|improve this answer

































            0














            I have in my ~/.byobu/.tmux.conf



            bind-key -t vi-copy 'v' begin-selection                                                                                                                                 
            bind-key -t vi-copy 'y' copy-selection


            so normally I can enter in copy mode by:



            Prefix + [



            then I can use vi commands to navigate and enter vi select mode by 'v'
            yank the selection by 'y'



            after that I can put/paste in the terminal by:



            Prefix + ]



            In order to copy a line:



                Prefix + [
            navigate to the line
            $ (jump to the end)
            Left Arrow
            v (begin-selection)
            0 (jump to the start of the line)
            y (yank and exit copy mode)

            Prefix + ] (paste the line)





            share|improve this answer































              -1














              Because of newer Tmux version I had to change my config:



              bind-key -T copy-mode-vi v send-keys -X begin-selection                                                                                                                 
              bind-key -T copy-mode-vi y send-keys -X copy-selection ; send-keys -X cancel


              Thanks to 'rushiagr' (http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting-ubuntu)






              share|improve this answer























                Your Answer








                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "106"
                };
                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: false,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: null,
                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%2funix.stackexchange.com%2fquestions%2f381704%2fbyobu-tmux-copy-whole-line%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














                A bit of an improvement: do space, V, enter instead of 0, space, $, enter. A single V is a lot easier to type than a 0 and a $. V is equivalent to vim's "do visual mode select of entire line" command.



                I can't speak to byobu directly but since it's just fronting tmux, you could also bind a key to all this in native tmux. Something like this:



                bind-key -r -T copy-mode-vi Y send-keys -X begin-selection ; send-keys -X select-line ; send-keys -X copy-selection


                Then you just enter copy mode, go to the line you want to copy, press Y then Enter. The line will now be in the paste buffer. (While that's a bit long and ugly it does work for me.)



                Edit: Tested with tmux 2.4






                share|improve this answer






























                  0














                  A bit of an improvement: do space, V, enter instead of 0, space, $, enter. A single V is a lot easier to type than a 0 and a $. V is equivalent to vim's "do visual mode select of entire line" command.



                  I can't speak to byobu directly but since it's just fronting tmux, you could also bind a key to all this in native tmux. Something like this:



                  bind-key -r -T copy-mode-vi Y send-keys -X begin-selection ; send-keys -X select-line ; send-keys -X copy-selection


                  Then you just enter copy mode, go to the line you want to copy, press Y then Enter. The line will now be in the paste buffer. (While that's a bit long and ugly it does work for me.)



                  Edit: Tested with tmux 2.4






                  share|improve this answer




























                    0












                    0








                    0







                    A bit of an improvement: do space, V, enter instead of 0, space, $, enter. A single V is a lot easier to type than a 0 and a $. V is equivalent to vim's "do visual mode select of entire line" command.



                    I can't speak to byobu directly but since it's just fronting tmux, you could also bind a key to all this in native tmux. Something like this:



                    bind-key -r -T copy-mode-vi Y send-keys -X begin-selection ; send-keys -X select-line ; send-keys -X copy-selection


                    Then you just enter copy mode, go to the line you want to copy, press Y then Enter. The line will now be in the paste buffer. (While that's a bit long and ugly it does work for me.)



                    Edit: Tested with tmux 2.4






                    share|improve this answer















                    A bit of an improvement: do space, V, enter instead of 0, space, $, enter. A single V is a lot easier to type than a 0 and a $. V is equivalent to vim's "do visual mode select of entire line" command.



                    I can't speak to byobu directly but since it's just fronting tmux, you could also bind a key to all this in native tmux. Something like this:



                    bind-key -r -T copy-mode-vi Y send-keys -X begin-selection ; send-keys -X select-line ; send-keys -X copy-selection


                    Then you just enter copy mode, go to the line you want to copy, press Y then Enter. The line will now be in the paste buffer. (While that's a bit long and ugly it does work for me.)



                    Edit: Tested with tmux 2.4







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jul 25 '17 at 19:31

























                    answered Jul 25 '17 at 14:32









                    B LayerB Layer

                    4,0241525




                    4,0241525

























                        0














                        I have in my ~/.byobu/.tmux.conf



                        bind-key -t vi-copy 'v' begin-selection                                                                                                                                 
                        bind-key -t vi-copy 'y' copy-selection


                        so normally I can enter in copy mode by:



                        Prefix + [



                        then I can use vi commands to navigate and enter vi select mode by 'v'
                        yank the selection by 'y'



                        after that I can put/paste in the terminal by:



                        Prefix + ]



                        In order to copy a line:



                            Prefix + [
                        navigate to the line
                        $ (jump to the end)
                        Left Arrow
                        v (begin-selection)
                        0 (jump to the start of the line)
                        y (yank and exit copy mode)

                        Prefix + ] (paste the line)





                        share|improve this answer




























                          0














                          I have in my ~/.byobu/.tmux.conf



                          bind-key -t vi-copy 'v' begin-selection                                                                                                                                 
                          bind-key -t vi-copy 'y' copy-selection


                          so normally I can enter in copy mode by:



                          Prefix + [



                          then I can use vi commands to navigate and enter vi select mode by 'v'
                          yank the selection by 'y'



                          after that I can put/paste in the terminal by:



                          Prefix + ]



                          In order to copy a line:



                              Prefix + [
                          navigate to the line
                          $ (jump to the end)
                          Left Arrow
                          v (begin-selection)
                          0 (jump to the start of the line)
                          y (yank and exit copy mode)

                          Prefix + ] (paste the line)





                          share|improve this answer


























                            0












                            0








                            0







                            I have in my ~/.byobu/.tmux.conf



                            bind-key -t vi-copy 'v' begin-selection                                                                                                                                 
                            bind-key -t vi-copy 'y' copy-selection


                            so normally I can enter in copy mode by:



                            Prefix + [



                            then I can use vi commands to navigate and enter vi select mode by 'v'
                            yank the selection by 'y'



                            after that I can put/paste in the terminal by:



                            Prefix + ]



                            In order to copy a line:



                                Prefix + [
                            navigate to the line
                            $ (jump to the end)
                            Left Arrow
                            v (begin-selection)
                            0 (jump to the start of the line)
                            y (yank and exit copy mode)

                            Prefix + ] (paste the line)





                            share|improve this answer













                            I have in my ~/.byobu/.tmux.conf



                            bind-key -t vi-copy 'v' begin-selection                                                                                                                                 
                            bind-key -t vi-copy 'y' copy-selection


                            so normally I can enter in copy mode by:



                            Prefix + [



                            then I can use vi commands to navigate and enter vi select mode by 'v'
                            yank the selection by 'y'



                            after that I can put/paste in the terminal by:



                            Prefix + ]



                            In order to copy a line:



                                Prefix + [
                            navigate to the line
                            $ (jump to the end)
                            Left Arrow
                            v (begin-selection)
                            0 (jump to the start of the line)
                            y (yank and exit copy mode)

                            Prefix + ] (paste the line)






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 1 '18 at 8:54









                            ZoliZoli

                            11




                            11























                                -1














                                Because of newer Tmux version I had to change my config:



                                bind-key -T copy-mode-vi v send-keys -X begin-selection                                                                                                                 
                                bind-key -T copy-mode-vi y send-keys -X copy-selection ; send-keys -X cancel


                                Thanks to 'rushiagr' (http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting-ubuntu)






                                share|improve this answer




























                                  -1














                                  Because of newer Tmux version I had to change my config:



                                  bind-key -T copy-mode-vi v send-keys -X begin-selection                                                                                                                 
                                  bind-key -T copy-mode-vi y send-keys -X copy-selection ; send-keys -X cancel


                                  Thanks to 'rushiagr' (http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting-ubuntu)






                                  share|improve this answer


























                                    -1












                                    -1








                                    -1







                                    Because of newer Tmux version I had to change my config:



                                    bind-key -T copy-mode-vi v send-keys -X begin-selection                                                                                                                 
                                    bind-key -T copy-mode-vi y send-keys -X copy-selection ; send-keys -X cancel


                                    Thanks to 'rushiagr' (http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting-ubuntu)






                                    share|improve this answer













                                    Because of newer Tmux version I had to change my config:



                                    bind-key -T copy-mode-vi v send-keys -X begin-selection                                                                                                                 
                                    bind-key -T copy-mode-vi y send-keys -X copy-selection ; send-keys -X cancel


                                    Thanks to 'rushiagr' (http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting-ubuntu)







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered 9 hours ago









                                    ZoliZoli

                                    11




                                    11






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                        • 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%2funix.stackexchange.com%2fquestions%2f381704%2fbyobu-tmux-copy-whole-line%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







                                        2TlIXuH6hya3,8ncg3yanBQ0JaPYGtlOg1D,Ym dpEnqaQAU4cYi,ozD4nC,fSMIMZ0Ieba2Rxk4Jx9BMV
                                        4GXh kVC4C MG88wOQ9pxUL1e12rSYNSPFttBjUO8SJ EeXEx2kNNMziw,9 ylDqV2LgTUVB,lsRDG5e YAQIim2hu

                                        Popular posts from this blog

                                        Mouloudia Club d'Alger (football)

                                        ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux

                                        Ueberstorf