Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 16 submissions in the queue.
posted by Fnord666 on Wednesday September 25 2019, @03:43AM   Printer-friendly
from the multitasking dept.

Arthur T Knackerbracket has found the following story:

Tmux is a very powerful terminal multiplexer which is extremely useful especially when you are using the remote server via SSH.

If we want to do multiple tasks simultaneously on the remote server, usually we have to two ways to do it. We could SSH into the remote server and run everything in the background with an ‘&’ at the end of each terminal command. This is problematic if you want to monitor the process of each task. We could also open multiple windows, SSH into the remote server for each window, and run one task for each window. This is good for monitoring all the tasks, but the shortcoming is that you would have to type your SSH login information for each of the windows you opened. Sometimes it is also hard to find which window is doing which task if there are too many windows opened.

Tmux allows the user to create multiple sessions and each session could have multiple terminals. The user would be able to control multiple tasks in multiple windows via Tmux. No more multiple SSH logins anymore. However, Tmux is not very friendly to beginners because you would have to memorize a series of commands required for controlling Tmux. Although Tmux is much useful than a terminal emulator such as Gnome Terminator, many users would just like to use Tmux as a multi-window terminal emulator. However, Tmux does not memorize user settings such as pane layouts, so every time after reboot or restart the Tmux server, all of the user settings will be gone.

In this short tutorial, I am going through some of the basic concepts and commands for Tmux, and how to use a Tmux plugin, which is called Tmux Resurrect, to restore Tmux environment after reboot or Tmux server restart.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 1, Offtopic) by aristarchus on Wednesday September 25 2019, @05:05AM (11 children)

    by aristarchus (2645) on Wednesday September 25 2019, @05:05AM (#898397) Journal

    But I don't want a Tmux Tutorial! I'd rather be neck deep in systemd. Or quantum computing my way to Marakkeesh.

    Starting Score:    1  point
    Moderation   -1  
       Offtopic=1, Total=1
    Extra 'Offtopic' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   1  
  • (Score: 3, Touché) by The Mighty Buzzard on Wednesday September 25 2019, @05:26AM (3 children)

    by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Wednesday September 25 2019, @05:26AM (#898399) Homepage Journal

    You'd have to RTFA to get the actual tutorial and I 'd have to double check but I think that's against SN's ToS.

    --
    My rights don't end where your fear begins.
    • (Score: 0) by Anonymous Coward on Wednesday September 25 2019, @06:04AM (2 children)

      by Anonymous Coward on Wednesday September 25 2019, @06:04AM (#898401)

      That would go against our CoC.

      • (Score: 2) by The Mighty Buzzard on Wednesday September 25 2019, @12:52PM

        by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Wednesday September 25 2019, @12:52PM (#898466) Homepage Journal

        Nice! Lot of folks pay good money for that sorta thing.

        --
        My rights don't end where your fear begins.
      • (Score: 2) by DannyB on Wednesday September 25 2019, @01:50PM

        by DannyB (5839) Subscriber Badge on Wednesday September 25 2019, @01:50PM (#898482) Journal

        A CoC is only acceptable if it meets two requirements:
        1. The text of the CoC is a direct violation of the meaning of the CoC. (eg, formally adopting the CoC is a violation of the CoC)
        2. most importantly: that the CoC can be sung to "the yellow rose of texas"

        --
        To transfer files: right-click on file, pick Copy. Unplug mouse, plug mouse into other computer. Right-click, paste.
  • (Score: 0) by Anonymous Coward on Wednesday September 25 2019, @06:10AM (6 children)

    by Anonymous Coward on Wednesday September 25 2019, @06:10AM (#898402)

    Great. Now that you used the terms "tmux" and "systemd" together in the same post, we are cursed to seeing "systemd-tty" arrive in six months and being a standard part of Linux distros in 24.

    • (Score: 3, Insightful) by aristarchus on Wednesday September 25 2019, @06:57AM

      by aristarchus (2645) on Wednesday September 25 2019, @06:57AM (#898406) Journal

      Cap't Lennart:

      Systemd expansion will continue until morale improves!

      Call me "Mr. Christian", but it is hardly my fault. I was doing all I could to improve morale!

      (Citation provided! [wikipedia.org])

    • (Score: 3, Interesting) by Anonymous Coward on Wednesday September 25 2019, @01:00PM (4 children)

      by Anonymous Coward on Wednesday September 25 2019, @01:00PM (#898469)

      systemd already tried to kill screen and tmux in favor of systemd-specific bullshit:

      "systemd-logind will now by default terminate user processes...you can no longer start a screen or tmux session, log out, and expect to come back to it"

      "[The fix is] two lines: [Login]\nKillUserProcesses=no. But please consider switching to the new mode of using systemd-run instead."

      • (Score: 0) by Anonymous Coward on Wednesday September 25 2019, @04:29PM (2 children)

        by Anonymous Coward on Wednesday September 25 2019, @04:29PM (#898603)

        I'm hoping that you just made that up.

        • (Score: 0) by Anonymous Coward on Thursday September 26 2019, @04:52AM (1 child)

          by Anonymous Coward on Thursday September 26 2019, @04:52AM (#898941)

          No joke. Citations:

          https://leadtosilverlining.blogspot.com/2019/01/setup-desktop-environment-on-google.html [blogspot.com]
          https://groups.google.com/forum/?_escaped_fragment_=topic/linux.debian.bugs.dist/XSGzxX4se4k#!topic/linux.debian.bugs.dist/XSGzxX4se4k [google.com]

          Choicequote:

          new requirement of having to enable lingering and starting
          tmux/screen/nohup/ via systemd-run can certainly be considered a
          nuisance and something our users are not necessarily aware of.

          And then their answer was to hack the applications!

          However, this really shouldn't be such a general problem: If/when we
          can change tmux and screen to use PAM or enable lingering, then I
          think we get the best of both worlds: Logging out would clean up
          properly, but the (relatively few) users who use screen/tmux on a PC
          would get the expected behaviour of those processes surviving.

          • (Score: 0) by Anonymous Coward on Thursday September 26 2019, @06:53AM

            by Anonymous Coward on Thursday September 26 2019, @06:53AM (#899003)

            I wonder if you could get around this by having a screen.service that executes "screen -D -m -S boot" on startup with a restart OnFailure. With one surviving screen process belonging to another user, it would seem all sessions would survive, even if systemd killed all the user-owned screen processes, but I'm not actually sure.

      • (Score: 0) by Anonymous Coward on Wednesday September 25 2019, @07:26PM

        by Anonymous Coward on Wednesday September 25 2019, @07:26PM (#898713)

        I forgot about that. Yet another reminder how systemd doesn't really consider it to be "my system" anymore.