1. 23
  1.  

  2. 3

    My goscreen alias looks like this:

    stty erase ^? ; screen -wipe ; screen -h 500 -d -R

    i.e., wipe dead sessions, then reattach to any live session, creating a new one if necessary. If I get disconnected, I log back in, type goscreen and I’m back where I was.

    1. 1

      What do you need the:

      stty erase ^?
      

      Exotic keyboard layout, so backspace doesn’t… Backspace?

      1. 2

        No, it’s a Mac keyboard and Delete is in that position.

        1. 3

          ba dum tss

          when did they start doing that? i have a 2007 mac keyboard and the key in the backspace position works as a backspace, as you would expect (though it is labeled “delete”)

    2. 3

      Why would I use screen over tmux? Honestly curious, have no experience with screen.

      1. 7

        It’s often preinstalled. Many users are familiar with it over tmux for that reason.

        1. 6

          There are many reasons, none of them is really general:

          • Being oldschool and being used to it. tmux is different and even if you change Ctrl-B back to Ctrl-A, it’s not a drop-in replacement.
          • Missing serial console support in tmux and some other more exotic features missing in tmux (probably on purpose).
          • IMHO easier to configure (albeit definitely less mighty)

          (Disclaimer: I’m the author of the linked blog posting and the maintainer of Debian’s screen package, so I’m probably biased. ;-)

          1. 5

            Screen is good enough, I know the shortcut keys I need and it does serial ports. There is nothing I need that it doesn’t do, so why change? Not all change is progress…

            1. 7

              Good summary, yes. :-)

              There are admittedly also some downsides: Most of the code of screen is ancient, has only few comments and is not easy to understand. It’s older than the Linux kernel. And despite it’s a GNU project these days, it started as IIRC “BSD Screen Manager” or so on BSDs.

              1. 1

                what’s wrong with old code?

                1. 3

                  The rest of the sentence says:

                  has only few comments and is not easy to understand

                  So, harder to maintain, fix, improve upon?

                  1. 1

                    that would be an issue, but i don’t see what that has to do with the age of the code

                    1. 2

                      Different common sense and coding style now and back then.

                      1. 2

                        Maybe, but two developers today may differ just as much in their common sense and coding style. It can be a pain to work on a code base written in a fancy IDE, if the author leaned on syntax highlighting and auto-completion to compensate for clunky names. There are a lot of factors that could make old code better or worse than new code.

                  2. 3

                    Nothing in general, but it tends to accumulate issues over time:

                    • Occasionally stops compiling with newer, more strict compilers.
                    • Does not adhere to current coding standards which usually focus on readability and avoiding common errors → harder to read, more error prone.
                      • Also might hinder attracting new contributors or maintainers.
                    • The current maintainers might no more know what the code was for if the original authors are no more around.
                    • At least Screen is known to have support for quite a few dead operating systems (think SunOS, etc.). These kind of tweaks can cause issues on modern operating systems. The master branch in Screen’s git repo has some cleanup on that, but unfortunately also kicked out some features which are still in use. No release has been made out of that branch anyway. I suspect that it will become version 5 if there will be ever a release out of that branch.
            2. 2

              In addition to the other answers… tmux feels generally more vim-like, while screen is more emacs-like. If you already have a preference in that game, that tends to color your perceptions of them.

              1. 2

                Any chance you could elaborate on that? I’ve never gone deep into configuring either of them, but by default both feel more emacsy in bindings. What is there beyond that?

                1. 2

                  Interesting. Never came to that thought, but at least it seems to fit for me: I’m a GNU Emacs (and GNU Zile) guy. :-)

                  Then again: I don’t see where Screen is very emacs-ish. So I’d also be interested in a more detailed explanation.

              2. 2

                Interesting. I use the equivalent, putting screen -R -D $(whoami) at the bottom of ~/.bash_profile on the host. At work we have a system where all the hosts mount a shared volume for /home, so I get the same home directory on all hosts.

                1. 1

                  Interesting, I used to have some sort of tmux attach in my .zshrc but in my experience on servers I always had to check for sessions first or it would exhibit weird behaviour if the server had ben rebooted. Maybe screen is more intelligent or one of the flags is “reattach and autocreate if not existing”?

                  1. 3

                    All of the terminals that I use these days provide a UUID in an environment variable. The macOS one preserves it across terminal restarts. I use the UUID for the remote session ID, so I can always reconnect (or autossh can for me). On macOS, I create a directory with a file containing the remote host name, whose name is the UUID and my .bashrc checks if this file exists and automatically reconnects. I can reboot my Mac and all of my SSH sessions reappear exactly where I left them.

                    I’ve moved from tmux to abduco recently, because tmux feature creep is annoying: I don’t want tmux to manage my scrollback, I have a terminal that does that. I don’t want tmux to do tabs / panes / windowing, I have a windowing system and terminal for that.

                    1. 1

                      Wow. abduco looks really neat and appears to mimic screen in the ways I use it daily. Thanks so much!