1

To be clear, this isn't a screen issue, I'm sure it's a general shell issue.

On a new Ubuntu 12.04 server, I'm currently logged into a terminal in which I want to run the screen command with my custom ~/.screenrc file. I scp'ed my .rc file to the Ubuntu machine and ran screen, but I can tell that it didn't read my .rc file. I tried several things in the current session:

  1. Run /bin/bash then screen
  2. sh then screen
  3. source the file and other weird environment variable tricks

The problem was easily fixed by creating a new ssh session into the Ubuntu server and running screen, but I'm curious - how do I make the .rc file 'work' in the original terminal that I was using before copying the .rc file?

1 Answer 1

1

It's not a general shell issue. A program you fire up (such as screen) reads its .rc-file when you start it—it doesn't try to determine if that file was created before or after you logged in. (And it couldn't; Linux has no reasonable way to check a file's creation time.)

So that's not what's going on. Instead, it's something about that login session. It could be (and this no doubt isn't an exhaustive list):

  • You already had screen running, and you wound up attaching to or creating a new window in your existing screen.
  • You were su or sudo to a different user (and thus put the .rc-file in the wrong home directory).
  • The environment was weird, e.g., $HOME was set to something funny. Note that sometimes su and sudo can lead to this, depending. (For other commands—I don't think screen uses it—it could also be a weird $XDG_CONFIG_HOME.)
  • Permissions are wrong. (Though probably not, since it worked on another login.)

Then there are of course the various "is it plugged in?" errors, e.g., one of the connections was to the wrong server.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .