Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Selfhosted
  3. Keeping track of different targets in terminal

Keeping track of different targets in terminal

Scheduled Pinned Locked Moved Selfhosted
selfhosted
15 Posts 12 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • father_redbeard@lemmy.mlF [email protected]

    I'm just using the Cosmic Terminal that's part of the Pop!_OS Cosmic Alpha, but I ran into similar issues with Gnome terminal and even with Termius.

    Scenario:
    I'm currently working on leveraging a VPS to act as the gateway to my homelab so I have one ssh session to Unraid server and one to VPS. One in each tab. Obviously the name shows up as what the username@servername is called in each tab. But I keep getting tripped up and sometimes try to do something from the wrong machine. Once I even failed to realize that the ssh session to one of them cut out and I was back on my desktop and took me an embarrassingly long time to realize why stuff was failing.

    So what are y'all using to keep that organized in your work flow? Separate terminal windows instead of tabs? Some shell customizations to make them look different than one another? Or just so ingrained in your brain that you never have this problem?

    EDIT: Thanks, everyone! Sounds like a terminal multiplexer is the ticket for me.

    e0qdk@reddthat.comE This user is from outside of this forum
    e0qdk@reddthat.comE This user is from outside of this forum
    [email protected]
    wrote last edited by
    #4

    I (manually) set the background color of my terminals depending on the machine I connect to. I currently have profiles for red, green, blue, and black backgrounds with black as my default. I usually use red for ones I want to be especially careful of.

    father_redbeard@lemmy.mlF 1 Reply Last reply
    1
    • father_redbeard@lemmy.mlF [email protected]

      I'm just using the Cosmic Terminal that's part of the Pop!_OS Cosmic Alpha, but I ran into similar issues with Gnome terminal and even with Termius.

      Scenario:
      I'm currently working on leveraging a VPS to act as the gateway to my homelab so I have one ssh session to Unraid server and one to VPS. One in each tab. Obviously the name shows up as what the username@servername is called in each tab. But I keep getting tripped up and sometimes try to do something from the wrong machine. Once I even failed to realize that the ssh session to one of them cut out and I was back on my desktop and took me an embarrassingly long time to realize why stuff was failing.

      So what are y'all using to keep that organized in your work flow? Separate terminal windows instead of tabs? Some shell customizations to make them look different than one another? Or just so ingrained in your brain that you never have this problem?

      EDIT: Thanks, everyone! Sounds like a terminal multiplexer is the ticket for me.

      S This user is from outside of this forum
      S This user is from outside of this forum
      [email protected]
      wrote last edited by
      #5

      i use tmux with named windows on each server and just terminals locally

      sxan@midwest.socialS borari@lemmy.dbzer0.comB 2 Replies Last reply
      3
      • father_redbeard@lemmy.mlF [email protected]

        I'm just using the Cosmic Terminal that's part of the Pop!_OS Cosmic Alpha, but I ran into similar issues with Gnome terminal and even with Termius.

        Scenario:
        I'm currently working on leveraging a VPS to act as the gateway to my homelab so I have one ssh session to Unraid server and one to VPS. One in each tab. Obviously the name shows up as what the username@servername is called in each tab. But I keep getting tripped up and sometimes try to do something from the wrong machine. Once I even failed to realize that the ssh session to one of them cut out and I was back on my desktop and took me an embarrassingly long time to realize why stuff was failing.

        So what are y'all using to keep that organized in your work flow? Separate terminal windows instead of tabs? Some shell customizations to make them look different than one another? Or just so ingrained in your brain that you never have this problem?

        EDIT: Thanks, everyone! Sounds like a terminal multiplexer is the ticket for me.

        eksb@programming.devE This user is from outside of this forum
        eksb@programming.devE This user is from outside of this forum
        [email protected]
        wrote last edited by
        #6

        I use tmux or screen, and set the status bar in different remotes to different colors.

        1 Reply Last reply
        4
        • D [email protected]

          You’ll get used to it eventually, but you can e.g. tweak your PS1 to an all-caps hostname, or use a custom tmux layout with dedicated panes for each box you connect to.

          isokiero@sopuli.xyzI This user is from outside of this forum
          isokiero@sopuli.xyzI This user is from outside of this forum
          [email protected]
          wrote last edited by
          #7

          You’ll get used to it eventually

          I've been earning my living mostly with connecting to remote systems via ssh (and other means) for quite a few years and I still occasionally mess up and enter commands on a wrong terminal. Less now than I used to, but it still happens. The trick is to learn youself to pause for a second and confirm the target for any potentially destructive or otherwise harmful command, no matter if it's locally or to some server other side of the world.

          1 Reply Last reply
          1
          • father_redbeard@lemmy.mlF [email protected]

            I'm just using the Cosmic Terminal that's part of the Pop!_OS Cosmic Alpha, but I ran into similar issues with Gnome terminal and even with Termius.

            Scenario:
            I'm currently working on leveraging a VPS to act as the gateway to my homelab so I have one ssh session to Unraid server and one to VPS. One in each tab. Obviously the name shows up as what the username@servername is called in each tab. But I keep getting tripped up and sometimes try to do something from the wrong machine. Once I even failed to realize that the ssh session to one of them cut out and I was back on my desktop and took me an embarrassingly long time to realize why stuff was failing.

            So what are y'all using to keep that organized in your work flow? Separate terminal windows instead of tabs? Some shell customizations to make them look different than one another? Or just so ingrained in your brain that you never have this problem?

            EDIT: Thanks, everyone! Sounds like a terminal multiplexer is the ticket for me.

            H This user is from outside of this forum
            H This user is from outside of this forum
            [email protected]
            wrote last edited by
            #8

            I made it so that the ps1 on my servers shows the servername@[server IP]

            1 Reply Last reply
            1
            • S [email protected]

              i use tmux with named windows on each server and just terminals locally

              sxan@midwest.socialS This user is from outside of this forum
              sxan@midwest.socialS This user is from outside of this forum
              [email protected]
              wrote last edited by
              #9

              I also have the prompt set to the host name. I've never understood why people included their usernames; I don't log in to more than one account on each machine.

              1 Reply Last reply
              2
              • father_redbeard@lemmy.mlF [email protected]

                I'm just using the Cosmic Terminal that's part of the Pop!_OS Cosmic Alpha, but I ran into similar issues with Gnome terminal and even with Termius.

                Scenario:
                I'm currently working on leveraging a VPS to act as the gateway to my homelab so I have one ssh session to Unraid server and one to VPS. One in each tab. Obviously the name shows up as what the username@servername is called in each tab. But I keep getting tripped up and sometimes try to do something from the wrong machine. Once I even failed to realize that the ssh session to one of them cut out and I was back on my desktop and took me an embarrassingly long time to realize why stuff was failing.

                So what are y'all using to keep that organized in your work flow? Separate terminal windows instead of tabs? Some shell customizations to make them look different than one another? Or just so ingrained in your brain that you never have this problem?

                EDIT: Thanks, everyone! Sounds like a terminal multiplexer is the ticket for me.

                N This user is from outside of this forum
                N This user is from outside of this forum
                [email protected]
                wrote last edited by [email protected]
                #10

                bash setup/config/PS1 is your friend here. I frequently find myself with a myriad of terminals between a bunch of usernames and servers at work, and setting up a proper prompt is key to help you keep track.

                My bashrc makes my prompt look like this:

                username@hostname:/absolute/path
                $ inputgoeshere

                ... with color coding, of course. Yes, I use a multiline prompt. I somehow never saw that before using ParrotSec despite being a bash user for 25 years. I modified the ParrotSec default to suit my needs better, and I like it:

                • Obvious which user I am.
                • Obvious which host I'm on.
                • Obvious which path I'm in.
                • It's easy to copy and paste a complete source/destination for pasting into, for example, an rsync comman

                I pasted my PS1 config here: https://pastebin.com/ZcYwabfB

                Stick that line near the bottom of your ~/.bashrc file if you want to try it out.

                father_redbeard@lemmy.mlF 1 Reply Last reply
                4
                • father_redbeard@lemmy.mlF [email protected]

                  I'm just using the Cosmic Terminal that's part of the Pop!_OS Cosmic Alpha, but I ran into similar issues with Gnome terminal and even with Termius.

                  Scenario:
                  I'm currently working on leveraging a VPS to act as the gateway to my homelab so I have one ssh session to Unraid server and one to VPS. One in each tab. Obviously the name shows up as what the username@servername is called in each tab. But I keep getting tripped up and sometimes try to do something from the wrong machine. Once I even failed to realize that the ssh session to one of them cut out and I was back on my desktop and took me an embarrassingly long time to realize why stuff was failing.

                  So what are y'all using to keep that organized in your work flow? Separate terminal windows instead of tabs? Some shell customizations to make them look different than one another? Or just so ingrained in your brain that you never have this problem?

                  EDIT: Thanks, everyone! Sounds like a terminal multiplexer is the ticket for me.

                  I This user is from outside of this forum
                  I This user is from outside of this forum
                  [email protected]
                  wrote last edited by
                  #11

                  For inspiration https://fedoramagazine.org/tuning-your-bash-or-zsh-shell-in-workstation-and-silverblue/

                  1 Reply Last reply
                  1
                  • S [email protected]

                    i use tmux with named windows on each server and just terminals locally

                    borari@lemmy.dbzer0.comB This user is from outside of this forum
                    borari@lemmy.dbzer0.comB This user is from outside of this forum
                    [email protected]
                    wrote last edited by
                    #12

                    Tmux is 100% what OP needs to be using.

                    1 Reply Last reply
                    0
                    • N [email protected]

                      bash setup/config/PS1 is your friend here. I frequently find myself with a myriad of terminals between a bunch of usernames and servers at work, and setting up a proper prompt is key to help you keep track.

                      My bashrc makes my prompt look like this:

                      username@hostname:/absolute/path
                      $ inputgoeshere

                      ... with color coding, of course. Yes, I use a multiline prompt. I somehow never saw that before using ParrotSec despite being a bash user for 25 years. I modified the ParrotSec default to suit my needs better, and I like it:

                      • Obvious which user I am.
                      • Obvious which host I'm on.
                      • Obvious which path I'm in.
                      • It's easy to copy and paste a complete source/destination for pasting into, for example, an rsync comman

                      I pasted my PS1 config here: https://pastebin.com/ZcYwabfB

                      Stick that line near the bottom of your ~/.bashrc file if you want to try it out.

                      father_redbeard@lemmy.mlF This user is from outside of this forum
                      father_redbeard@lemmy.mlF This user is from outside of this forum
                      [email protected]
                      wrote last edited by
                      #13

                      Hey that's super helpful, thank you. Definitely going to try this out.

                      1 Reply Last reply
                      1
                      • e0qdk@reddthat.comE [email protected]

                        I (manually) set the background color of my terminals depending on the machine I connect to. I currently have profiles for red, green, blue, and black backgrounds with black as my default. I usually use red for ones I want to be especially careful of.

                        father_redbeard@lemmy.mlF This user is from outside of this forum
                        father_redbeard@lemmy.mlF This user is from outside of this forum
                        [email protected]
                        wrote last edited by
                        #14

                        That's a great idea. Do you have it persist between sessions? Like one server #1 it's always green?

                        e0qdk@reddthat.comE 1 Reply Last reply
                        1
                        • father_redbeard@lemmy.mlF [email protected]

                          That's a great idea. Do you have it persist between sessions? Like one server #1 it's always green?

                          e0qdk@reddthat.comE This user is from outside of this forum
                          e0qdk@reddthat.comE This user is from outside of this forum
                          [email protected]
                          wrote last edited by
                          #15

                          I just right click on the terminal to change the profile to whatever I feel like it should be in the moment (usually red). I do it by reflex, basically. I never felt the need to try to set up automation for different servers, but I expect there's probably a way to do that if you really wanted to.

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups