Interactive search of tmux sessions and windows with synchronize-panes on












0















I use this tmux-configuration based on the post from bartj3 in [1].



bind j split-window -v "tmux list-sessions -F '#S' | fzf --reverse | xargs tmux switch-client -t"
bind k split-window -v "tmux list-window -F '#W' | fzf --reverse | xargs tmux select-window -t"


It let's you interactively (search-as-you-type) search for other sessions and windows by name and therefore switch between them more efficiently.



PROBLEM:



If you use the above while synchronize-panes is on, your search key-strokes will also type in the other (non-search-)panes.



QUESTION:



Does anyone have an idea on how to limit the key-strokes to the search-pane?



[1] Interactive search of tmux sessions










share|improve this question



























    0















    I use this tmux-configuration based on the post from bartj3 in [1].



    bind j split-window -v "tmux list-sessions -F '#S' | fzf --reverse | xargs tmux switch-client -t"
    bind k split-window -v "tmux list-window -F '#W' | fzf --reverse | xargs tmux select-window -t"


    It let's you interactively (search-as-you-type) search for other sessions and windows by name and therefore switch between them more efficiently.



    PROBLEM:



    If you use the above while synchronize-panes is on, your search key-strokes will also type in the other (non-search-)panes.



    QUESTION:



    Does anyone have an idea on how to limit the key-strokes to the search-pane?



    [1] Interactive search of tmux sessions










    share|improve this question

























      0












      0








      0








      I use this tmux-configuration based on the post from bartj3 in [1].



      bind j split-window -v "tmux list-sessions -F '#S' | fzf --reverse | xargs tmux switch-client -t"
      bind k split-window -v "tmux list-window -F '#W' | fzf --reverse | xargs tmux select-window -t"


      It let's you interactively (search-as-you-type) search for other sessions and windows by name and therefore switch between them more efficiently.



      PROBLEM:



      If you use the above while synchronize-panes is on, your search key-strokes will also type in the other (non-search-)panes.



      QUESTION:



      Does anyone have an idea on how to limit the key-strokes to the search-pane?



      [1] Interactive search of tmux sessions










      share|improve this question














      I use this tmux-configuration based on the post from bartj3 in [1].



      bind j split-window -v "tmux list-sessions -F '#S' | fzf --reverse | xargs tmux switch-client -t"
      bind k split-window -v "tmux list-window -F '#W' | fzf --reverse | xargs tmux select-window -t"


      It let's you interactively (search-as-you-type) search for other sessions and windows by name and therefore switch between them more efficiently.



      PROBLEM:



      If you use the above while synchronize-panes is on, your search key-strokes will also type in the other (non-search-)panes.



      QUESTION:



      Does anyone have an idea on how to limit the key-strokes to the search-pane?



      [1] Interactive search of tmux sessions







      search tmux






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 22 at 23:19









      s3_s3_

      31




      31






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You can save the current state of synchronize-panes before calling fzf, and then restore it to on afterwards if necessary. For example, this works for me, using bash as the default shell:



          bind-key k split-window -v '
          if [[ $(tmux show-window-option synchronize-panes) == *on ]];
          then tmux set-window-option -q synchronize-panes off;
          restore="tmux set-window-option -q synchronize-panes on";
          fi;
          tmux list-windows -F "#W" | fzf --reverse | xargs tmux select-window -t;
          $restore'


          Since this is a long shell command, it can be split over many lines provided they each end with a backslash, and shell semi-colons (;) are used as if it was all on one line. You might prefer to put this as a shell script in a file in your PATH and call it instead.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            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%2fsuperuser.com%2fquestions%2f1397211%2finteractive-search-of-tmux-sessions-and-windows-with-synchronize-panes-on%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You can save the current state of synchronize-panes before calling fzf, and then restore it to on afterwards if necessary. For example, this works for me, using bash as the default shell:



            bind-key k split-window -v '
            if [[ $(tmux show-window-option synchronize-panes) == *on ]];
            then tmux set-window-option -q synchronize-panes off;
            restore="tmux set-window-option -q synchronize-panes on";
            fi;
            tmux list-windows -F "#W" | fzf --reverse | xargs tmux select-window -t;
            $restore'


            Since this is a long shell command, it can be split over many lines provided they each end with a backslash, and shell semi-colons (;) are used as if it was all on one line. You might prefer to put this as a shell script in a file in your PATH and call it instead.






            share|improve this answer




























              0














              You can save the current state of synchronize-panes before calling fzf, and then restore it to on afterwards if necessary. For example, this works for me, using bash as the default shell:



              bind-key k split-window -v '
              if [[ $(tmux show-window-option synchronize-panes) == *on ]];
              then tmux set-window-option -q synchronize-panes off;
              restore="tmux set-window-option -q synchronize-panes on";
              fi;
              tmux list-windows -F "#W" | fzf --reverse | xargs tmux select-window -t;
              $restore'


              Since this is a long shell command, it can be split over many lines provided they each end with a backslash, and shell semi-colons (;) are used as if it was all on one line. You might prefer to put this as a shell script in a file in your PATH and call it instead.






              share|improve this answer


























                0












                0








                0







                You can save the current state of synchronize-panes before calling fzf, and then restore it to on afterwards if necessary. For example, this works for me, using bash as the default shell:



                bind-key k split-window -v '
                if [[ $(tmux show-window-option synchronize-panes) == *on ]];
                then tmux set-window-option -q synchronize-panes off;
                restore="tmux set-window-option -q synchronize-panes on";
                fi;
                tmux list-windows -F "#W" | fzf --reverse | xargs tmux select-window -t;
                $restore'


                Since this is a long shell command, it can be split over many lines provided they each end with a backslash, and shell semi-colons (;) are used as if it was all on one line. You might prefer to put this as a shell script in a file in your PATH and call it instead.






                share|improve this answer













                You can save the current state of synchronize-panes before calling fzf, and then restore it to on afterwards if necessary. For example, this works for me, using bash as the default shell:



                bind-key k split-window -v '
                if [[ $(tmux show-window-option synchronize-panes) == *on ]];
                then tmux set-window-option -q synchronize-panes off;
                restore="tmux set-window-option -q synchronize-panes on";
                fi;
                tmux list-windows -F "#W" | fzf --reverse | xargs tmux select-window -t;
                $restore'


                Since this is a long shell command, it can be split over many lines provided they each end with a backslash, and shell semi-colons (;) are used as if it was all on one line. You might prefer to put this as a shell script in a file in your PATH and call it instead.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 27 at 18:38









                meuhmeuh

                3,65511021




                3,65511021






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • 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%2fsuperuser.com%2fquestions%2f1397211%2finteractive-search-of-tmux-sessions-and-windows-with-synchronize-panes-on%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

                    Список кардиналов, возведённых папой римским Каликстом III

                    Deduzione

                    Mysql.sock missing - “Can't connect to local MySQL server through socket”