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.

  • neidu3@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    9
    ·
    edit-2
    2 days ago

    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.