Log in

Bekijk de volledige versie : aliases don't work inside a screen session



Amiga68k
05-09-2008, 12:27
Hi,

I setup some aliases to make life inside the terminal more easier, for instance I got the following in my /opt/etc/profile:

alias mc="mc -c"
alias ls="ls --color=auto -la"
alias df="df -h"

I'm also a user of the tool "screen" which lets me do more at the same time. But, here comes my problem, the aliases do not work from a screen session, when I type alias in such a session it comes up with nothing.

Anyone have a clue of what I'm doing wrong here?

Greets

Amiga68k
07-09-2008, 21:33
Hi,

Ok, I figured it out by combining some forum entry's here and there, so if anyone experiences the same issue, here is a little tutorial:

cd /usr/local/root
touch .screenrc

add the following entry in .screenrc:

shell -$SHELL

The following is said about this on a forum I found the answer:

this makes the shells think that they are login shells and have to do full initialisation. For csh-like shells this means, that both .login and .cshrc files will be loaded. Ususally people are satisfied when shells under screen only sources their .cshrc file.

To keep this file after a reboot do:

flashfs save && flashfs commit && flashfs enable

That's it, open a new screen session and try those handy aliases.

Greets

griefff
07-09-2008, 21:34
Thx for providing a solution, appreciated!

cya