In tmux how to set pane specific variable to display in the pane status bar for that pane only

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












In tmux, how do I create a function that will set a variable that will then be available to use within tmux pane border status:



set -g pane-border-format


so I can then run that function and have the value set but only for that pane and nowhere else so that the border status displays something different for that pane and if I run that function in another pane, the pane border status will display something else but only for the pane that the function was runin



so if I run the function in pane 1 to say 'hello world' then in pane 2 to say 'goodby world' I expect pane 1 border status to say 'hello world' and pane 2 border status to say 'goodby world'.










share|improve this question



























    up vote
    0
    down vote

    favorite












    In tmux, how do I create a function that will set a variable that will then be available to use within tmux pane border status:



    set -g pane-border-format


    so I can then run that function and have the value set but only for that pane and nowhere else so that the border status displays something different for that pane and if I run that function in another pane, the pane border status will display something else but only for the pane that the function was runin



    so if I run the function in pane 1 to say 'hello world' then in pane 2 to say 'goodby world' I expect pane 1 border status to say 'hello world' and pane 2 border status to say 'goodby world'.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      In tmux, how do I create a function that will set a variable that will then be available to use within tmux pane border status:



      set -g pane-border-format


      so I can then run that function and have the value set but only for that pane and nowhere else so that the border status displays something different for that pane and if I run that function in another pane, the pane border status will display something else but only for the pane that the function was runin



      so if I run the function in pane 1 to say 'hello world' then in pane 2 to say 'goodby world' I expect pane 1 border status to say 'hello world' and pane 2 border status to say 'goodby world'.










      share|improve this question















      In tmux, how do I create a function that will set a variable that will then be available to use within tmux pane border status:



      set -g pane-border-format


      so I can then run that function and have the value set but only for that pane and nowhere else so that the border status displays something different for that pane and if I run that function in another pane, the pane border status will display something else but only for the pane that the function was runin



      so if I run the function in pane 1 to say 'hello world' then in pane 2 to say 'goodby world' I expect pane 1 border status to say 'hello world' and pane 2 border status to say 'goodby world'.







      shell-script zsh tmux






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 7 at 12:05

























      asked Aug 7 at 11:25









      Thermatix

      19918




      19918




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          I found out how to set user options, so I created a function to automate this:



          if [ -n "$TMUX" ]; then

          function set_tmux_opt
          tmux set -q "@$1_$TMUX_PANE" "$2"


          fi


          and it's used like this:



          set_tmux_opt 'some_variable' '1'


          and I get it like this:



          function get_tmux_opt 
          tmux show -v "@$1_$2"



          and used like this:



          $pane_id="$1
          get_tmux_opt 'some_variable' $pane_id


          and then passed into the script using pane_id






          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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f461047%2fin-tmux-how-to-set-pane-specific-variable-to-display-in-the-pane-status-bar-for%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            I found out how to set user options, so I created a function to automate this:



            if [ -n "$TMUX" ]; then

            function set_tmux_opt
            tmux set -q "@$1_$TMUX_PANE" "$2"


            fi


            and it's used like this:



            set_tmux_opt 'some_variable' '1'


            and I get it like this:



            function get_tmux_opt 
            tmux show -v "@$1_$2"



            and used like this:



            $pane_id="$1
            get_tmux_opt 'some_variable' $pane_id


            and then passed into the script using pane_id






            share|improve this answer
























              up vote
              1
              down vote













              I found out how to set user options, so I created a function to automate this:



              if [ -n "$TMUX" ]; then

              function set_tmux_opt
              tmux set -q "@$1_$TMUX_PANE" "$2"


              fi


              and it's used like this:



              set_tmux_opt 'some_variable' '1'


              and I get it like this:



              function get_tmux_opt 
              tmux show -v "@$1_$2"



              and used like this:



              $pane_id="$1
              get_tmux_opt 'some_variable' $pane_id


              and then passed into the script using pane_id






              share|improve this answer






















                up vote
                1
                down vote










                up vote
                1
                down vote









                I found out how to set user options, so I created a function to automate this:



                if [ -n "$TMUX" ]; then

                function set_tmux_opt
                tmux set -q "@$1_$TMUX_PANE" "$2"


                fi


                and it's used like this:



                set_tmux_opt 'some_variable' '1'


                and I get it like this:



                function get_tmux_opt 
                tmux show -v "@$1_$2"



                and used like this:



                $pane_id="$1
                get_tmux_opt 'some_variable' $pane_id


                and then passed into the script using pane_id






                share|improve this answer












                I found out how to set user options, so I created a function to automate this:



                if [ -n "$TMUX" ]; then

                function set_tmux_opt
                tmux set -q "@$1_$TMUX_PANE" "$2"


                fi


                and it's used like this:



                set_tmux_opt 'some_variable' '1'


                and I get it like this:



                function get_tmux_opt 
                tmux show -v "@$1_$2"



                and used like this:



                $pane_id="$1
                get_tmux_opt 'some_variable' $pane_id


                and then passed into the script using pane_id







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 7 at 13:05









                Thermatix

                19918




                19918



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461047%2fin-tmux-how-to-set-pane-specific-variable-to-display-in-the-pane-status-bar-for%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay