6
TrayKnots
52d

Just a quick follow up. I told you guys after rebooting my server by accident, I'll color in the terminals for my ssh connections.

Normal terminal in white. With the code to do it. Just a shell script with the name ssh earlier in the path than the actual ssh. That was the only solution that didn't fuck my auto-completion. compdef was somehow useless. But it is simple.

For some reason I had to hardcode the return color to white. Alacritty was not happy with just a no-color code. But whatever. Super useful. I won't accidentally restart non-host computers now.

Planning on extending this to have different colors according to the host. Like my homelab could be green. Live servers would be red. Dev servers blue. But that's for the future.

Just wanted to share my little improvement that will make my computing saver.

Comments
  • 2
    I’ve done this for years, and can’t recommend it enough!

    With Terminator I use banners instead of background colors. Less glaring.
  • 1
    @Root Can you post a pic what that looks like?
  • 2
    That's not really removing background but you're using f-ing rgb in ansi? Fuck, if I knew that was possible. Thanks. Learned smth
  • 1
    @retoor

    There is a code that removes the color. But for some crazy reason, it had no effect. Therefore I just add add my terminal's default color back in.

    Will be annoying the next time I change themes again, but hey, maybe that will make me figure out why the color remove code didn't work.
  • 1
    @TrayKnots I use "\e[0m" for clearing and nothing behind it
  • 1
    @retoor

    Cannot tell you why, but I just tried it again with your code. It doesn't work. I could probably troubleshoot and figure this one out, but I guess I just accept it for now.

    Note, it recognized your code as color code. Otherwise I would get a printout. I don't. But it just doesn't change the color back.
  • 1
    @TrayKnots oh, very weird. This code normally removes all visuals including bold/italic and stuff. Thanks for trying.

    trap abort SIGINT cool stuff btw
  • 0
    Oh, wow. My script broke git.

    I cannot use the script and git at the same time... Git uses also ssh and it just calls the ssh command from the path. Hmm.. Back to the drawing board.
Add Comment