What is the “control mode” in tmux?

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











up vote
0
down vote

favorite












According to man tmux to check the launch option:




-C: Start in control mode (see the CONTROL MODE section). Given
twice (-CC) disables echo.




Then in the control mode section of the man tmux, there is the following description:



CONTROL MODE
tmux offers a textual interface called control mode. This allows
applications to communicate with tmux using a simple text-only protocol.

In control mode, a client sends tmux commands or command sequences
terminated by newlines on standard input. Each command will produce one
block of output on standard output. An output block consists of a %begin
line followed by the output (which may be empty). The output block ends
with a %end or %error. %begin and matching %end or %error have two
arguments: an integer time (as seconds from epoch) and command number.
For example:

%begin 1363006971 2
0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active)
%end 1363006971 2

The refresh-client -C command may be used to set the size of a client in
control mode.

In control mode, tmux outputs notifications. A notification will never
occur inside an output block.


I'm not sure what it means, but at least as far as I try a few commands and try to see the looks and feels of it via (tmux -CC), it looks like the same as when I launch via tmux new-session.



So what is the "control mode" and what makes it different from the normal mode?




EDIT



I found that the session and the window that was launched via the control mode (-CC) does not react to the keyboard shortcut of the tmux commands, such as window split. So what is the point of using the control mode in the first place?







share|improve this question

















  • 1




    tmux does support copy and paste, see capture-pane and save-buffer and related commands
    – thrig
    Jul 4 at 13:44










  • @thrig Sorry what I read was wrong; tmux does support it but does not the mouse-based copy & paste. It seems feasible via third-party plugins like tmux-yank, though I have not tried it yet.
    – Blaszard
    Jul 4 at 13:54










  • Do you already have a tmux session running when you try tmux -C or tmux -CC?
    – JigglyNaga
    Jul 4 at 17:07










  • @JigglyNaga I tried both situations but the result was consistent.
    – Blaszard
    Jul 4 at 17:31










  • @Blaszard if you enable mouse support, you can enable copy by highlighting with your mouse.
    – rovr138
    Jul 4 at 18:08














up vote
0
down vote

favorite












According to man tmux to check the launch option:




-C: Start in control mode (see the CONTROL MODE section). Given
twice (-CC) disables echo.




Then in the control mode section of the man tmux, there is the following description:



CONTROL MODE
tmux offers a textual interface called control mode. This allows
applications to communicate with tmux using a simple text-only protocol.

In control mode, a client sends tmux commands or command sequences
terminated by newlines on standard input. Each command will produce one
block of output on standard output. An output block consists of a %begin
line followed by the output (which may be empty). The output block ends
with a %end or %error. %begin and matching %end or %error have two
arguments: an integer time (as seconds from epoch) and command number.
For example:

%begin 1363006971 2
0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active)
%end 1363006971 2

The refresh-client -C command may be used to set the size of a client in
control mode.

In control mode, tmux outputs notifications. A notification will never
occur inside an output block.


I'm not sure what it means, but at least as far as I try a few commands and try to see the looks and feels of it via (tmux -CC), it looks like the same as when I launch via tmux new-session.



So what is the "control mode" and what makes it different from the normal mode?




EDIT



I found that the session and the window that was launched via the control mode (-CC) does not react to the keyboard shortcut of the tmux commands, such as window split. So what is the point of using the control mode in the first place?







share|improve this question

















  • 1




    tmux does support copy and paste, see capture-pane and save-buffer and related commands
    – thrig
    Jul 4 at 13:44










  • @thrig Sorry what I read was wrong; tmux does support it but does not the mouse-based copy & paste. It seems feasible via third-party plugins like tmux-yank, though I have not tried it yet.
    – Blaszard
    Jul 4 at 13:54










  • Do you already have a tmux session running when you try tmux -C or tmux -CC?
    – JigglyNaga
    Jul 4 at 17:07










  • @JigglyNaga I tried both situations but the result was consistent.
    – Blaszard
    Jul 4 at 17:31










  • @Blaszard if you enable mouse support, you can enable copy by highlighting with your mouse.
    – rovr138
    Jul 4 at 18:08












up vote
0
down vote

favorite









up vote
0
down vote

favorite











According to man tmux to check the launch option:




-C: Start in control mode (see the CONTROL MODE section). Given
twice (-CC) disables echo.




Then in the control mode section of the man tmux, there is the following description:



CONTROL MODE
tmux offers a textual interface called control mode. This allows
applications to communicate with tmux using a simple text-only protocol.

In control mode, a client sends tmux commands or command sequences
terminated by newlines on standard input. Each command will produce one
block of output on standard output. An output block consists of a %begin
line followed by the output (which may be empty). The output block ends
with a %end or %error. %begin and matching %end or %error have two
arguments: an integer time (as seconds from epoch) and command number.
For example:

%begin 1363006971 2
0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active)
%end 1363006971 2

The refresh-client -C command may be used to set the size of a client in
control mode.

In control mode, tmux outputs notifications. A notification will never
occur inside an output block.


I'm not sure what it means, but at least as far as I try a few commands and try to see the looks and feels of it via (tmux -CC), it looks like the same as when I launch via tmux new-session.



So what is the "control mode" and what makes it different from the normal mode?




EDIT



I found that the session and the window that was launched via the control mode (-CC) does not react to the keyboard shortcut of the tmux commands, such as window split. So what is the point of using the control mode in the first place?







share|improve this question













According to man tmux to check the launch option:




-C: Start in control mode (see the CONTROL MODE section). Given
twice (-CC) disables echo.




Then in the control mode section of the man tmux, there is the following description:



CONTROL MODE
tmux offers a textual interface called control mode. This allows
applications to communicate with tmux using a simple text-only protocol.

In control mode, a client sends tmux commands or command sequences
terminated by newlines on standard input. Each command will produce one
block of output on standard output. An output block consists of a %begin
line followed by the output (which may be empty). The output block ends
with a %end or %error. %begin and matching %end or %error have two
arguments: an integer time (as seconds from epoch) and command number.
For example:

%begin 1363006971 2
0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active)
%end 1363006971 2

The refresh-client -C command may be used to set the size of a client in
control mode.

In control mode, tmux outputs notifications. A notification will never
occur inside an output block.


I'm not sure what it means, but at least as far as I try a few commands and try to see the looks and feels of it via (tmux -CC), it looks like the same as when I launch via tmux new-session.



So what is the "control mode" and what makes it different from the normal mode?




EDIT



I found that the session and the window that was launched via the control mode (-CC) does not react to the keyboard shortcut of the tmux commands, such as window split. So what is the point of using the control mode in the first place?









share|improve this question












share|improve this question




share|improve this question








edited Jul 5 at 9:50
























asked Jul 4 at 13:34









Blaszard

121117




121117







  • 1




    tmux does support copy and paste, see capture-pane and save-buffer and related commands
    – thrig
    Jul 4 at 13:44










  • @thrig Sorry what I read was wrong; tmux does support it but does not the mouse-based copy & paste. It seems feasible via third-party plugins like tmux-yank, though I have not tried it yet.
    – Blaszard
    Jul 4 at 13:54










  • Do you already have a tmux session running when you try tmux -C or tmux -CC?
    – JigglyNaga
    Jul 4 at 17:07










  • @JigglyNaga I tried both situations but the result was consistent.
    – Blaszard
    Jul 4 at 17:31










  • @Blaszard if you enable mouse support, you can enable copy by highlighting with your mouse.
    – rovr138
    Jul 4 at 18:08












  • 1




    tmux does support copy and paste, see capture-pane and save-buffer and related commands
    – thrig
    Jul 4 at 13:44










  • @thrig Sorry what I read was wrong; tmux does support it but does not the mouse-based copy & paste. It seems feasible via third-party plugins like tmux-yank, though I have not tried it yet.
    – Blaszard
    Jul 4 at 13:54










  • Do you already have a tmux session running when you try tmux -C or tmux -CC?
    – JigglyNaga
    Jul 4 at 17:07










  • @JigglyNaga I tried both situations but the result was consistent.
    – Blaszard
    Jul 4 at 17:31










  • @Blaszard if you enable mouse support, you can enable copy by highlighting with your mouse.
    – rovr138
    Jul 4 at 18:08







1




1




tmux does support copy and paste, see capture-pane and save-buffer and related commands
– thrig
Jul 4 at 13:44




tmux does support copy and paste, see capture-pane and save-buffer and related commands
– thrig
Jul 4 at 13:44












@thrig Sorry what I read was wrong; tmux does support it but does not the mouse-based copy & paste. It seems feasible via third-party plugins like tmux-yank, though I have not tried it yet.
– Blaszard
Jul 4 at 13:54




@thrig Sorry what I read was wrong; tmux does support it but does not the mouse-based copy & paste. It seems feasible via third-party plugins like tmux-yank, though I have not tried it yet.
– Blaszard
Jul 4 at 13:54












Do you already have a tmux session running when you try tmux -C or tmux -CC?
– JigglyNaga
Jul 4 at 17:07




Do you already have a tmux session running when you try tmux -C or tmux -CC?
– JigglyNaga
Jul 4 at 17:07












@JigglyNaga I tried both situations but the result was consistent.
– Blaszard
Jul 4 at 17:31




@JigglyNaga I tried both situations but the result was consistent.
– Blaszard
Jul 4 at 17:31












@Blaszard if you enable mouse support, you can enable copy by highlighting with your mouse.
– rovr138
Jul 4 at 18:08




@Blaszard if you enable mouse support, you can enable copy by highlighting with your mouse.
– rovr138
Jul 4 at 18:08










2 Answers
2






active

oldest

votes

















up vote
1
down vote













The interesting aspect of control mode is that
you can write a background process that listens to a real tmux process. It gets notifications of
things happening in the real tmux, and it can then send
commands. If you use 2
terminals and run a normal session in one



tmux new -s mysession


and in the other



tmux -C attach -t mysession


then when you split windows, add new ones, or close them in the normal tmux
you will get lines like



%layout-change @2 91a8,80x23,0,0[80x11,0,0,5,80x11,0,12,7]
%window-add @3
%window-close @1


in the control tmux, to which you can react by writing a program. To help
there is a python library to exploit
this mechanism. See the examples there.






share|improve this answer




























    up vote
    0
    down vote













    You are seeing similar results from tmux -CC as you would from tmux new-session because you didn't specify a command, so tmux uses the default, which is new-session:




    command [flags]



    This specifies one of a set of commands used to control tmux, as described in the following sections. If no commands are specified, the new-session command is assumed.




    Adding -CC doesn't appear to change that. To control the existing session, you should attach to it in control mode:



    tmux -C attach





    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%2f453436%2fwhat-is-the-control-mode-in-tmux%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      1
      down vote













      The interesting aspect of control mode is that
      you can write a background process that listens to a real tmux process. It gets notifications of
      things happening in the real tmux, and it can then send
      commands. If you use 2
      terminals and run a normal session in one



      tmux new -s mysession


      and in the other



      tmux -C attach -t mysession


      then when you split windows, add new ones, or close them in the normal tmux
      you will get lines like



      %layout-change @2 91a8,80x23,0,0[80x11,0,0,5,80x11,0,12,7]
      %window-add @3
      %window-close @1


      in the control tmux, to which you can react by writing a program. To help
      there is a python library to exploit
      this mechanism. See the examples there.






      share|improve this answer

























        up vote
        1
        down vote













        The interesting aspect of control mode is that
        you can write a background process that listens to a real tmux process. It gets notifications of
        things happening in the real tmux, and it can then send
        commands. If you use 2
        terminals and run a normal session in one



        tmux new -s mysession


        and in the other



        tmux -C attach -t mysession


        then when you split windows, add new ones, or close them in the normal tmux
        you will get lines like



        %layout-change @2 91a8,80x23,0,0[80x11,0,0,5,80x11,0,12,7]
        %window-add @3
        %window-close @1


        in the control tmux, to which you can react by writing a program. To help
        there is a python library to exploit
        this mechanism. See the examples there.






        share|improve this answer























          up vote
          1
          down vote










          up vote
          1
          down vote









          The interesting aspect of control mode is that
          you can write a background process that listens to a real tmux process. It gets notifications of
          things happening in the real tmux, and it can then send
          commands. If you use 2
          terminals and run a normal session in one



          tmux new -s mysession


          and in the other



          tmux -C attach -t mysession


          then when you split windows, add new ones, or close them in the normal tmux
          you will get lines like



          %layout-change @2 91a8,80x23,0,0[80x11,0,0,5,80x11,0,12,7]
          %window-add @3
          %window-close @1


          in the control tmux, to which you can react by writing a program. To help
          there is a python library to exploit
          this mechanism. See the examples there.






          share|improve this answer













          The interesting aspect of control mode is that
          you can write a background process that listens to a real tmux process. It gets notifications of
          things happening in the real tmux, and it can then send
          commands. If you use 2
          terminals and run a normal session in one



          tmux new -s mysession


          and in the other



          tmux -C attach -t mysession


          then when you split windows, add new ones, or close them in the normal tmux
          you will get lines like



          %layout-change @2 91a8,80x23,0,0[80x11,0,0,5,80x11,0,12,7]
          %window-add @3
          %window-close @1


          in the control tmux, to which you can react by writing a program. To help
          there is a python library to exploit
          this mechanism. See the examples there.







          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered Jul 4 at 17:59









          meuh

          29k11648




          29k11648






















              up vote
              0
              down vote













              You are seeing similar results from tmux -CC as you would from tmux new-session because you didn't specify a command, so tmux uses the default, which is new-session:




              command [flags]



              This specifies one of a set of commands used to control tmux, as described in the following sections. If no commands are specified, the new-session command is assumed.




              Adding -CC doesn't appear to change that. To control the existing session, you should attach to it in control mode:



              tmux -C attach





              share|improve this answer

























                up vote
                0
                down vote













                You are seeing similar results from tmux -CC as you would from tmux new-session because you didn't specify a command, so tmux uses the default, which is new-session:




                command [flags]



                This specifies one of a set of commands used to control tmux, as described in the following sections. If no commands are specified, the new-session command is assumed.




                Adding -CC doesn't appear to change that. To control the existing session, you should attach to it in control mode:



                tmux -C attach





                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  You are seeing similar results from tmux -CC as you would from tmux new-session because you didn't specify a command, so tmux uses the default, which is new-session:




                  command [flags]



                  This specifies one of a set of commands used to control tmux, as described in the following sections. If no commands are specified, the new-session command is assumed.




                  Adding -CC doesn't appear to change that. To control the existing session, you should attach to it in control mode:



                  tmux -C attach





                  share|improve this answer













                  You are seeing similar results from tmux -CC as you would from tmux new-session because you didn't specify a command, so tmux uses the default, which is new-session:




                  command [flags]



                  This specifies one of a set of commands used to control tmux, as described in the following sections. If no commands are specified, the new-session command is assumed.




                  Adding -CC doesn't appear to change that. To control the existing session, you should attach to it in control mode:



                  tmux -C attach






                  share|improve this answer













                  share|improve this answer



                  share|improve this answer











                  answered Jul 4 at 18:05









                  JigglyNaga

                  2,556623




                  2,556623






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f453436%2fwhat-is-the-control-mode-in-tmux%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?

                      Displaying single band from multi-band raster using QGIS

                      How many registers does an x86_64 CPU actually have?