GNU Screen doesn't start shells as a login shell
I want to have an ls' output colorization in gnu screen. Colorization in my system (Slackware 13) is realized by aliasing of ls in /etc/profile.d/coreutils-dircolors.sh:
Code:
$ alias ls Code:
$ echo $LS_OPTIONS Code:
shell -$SHELL |
Assuming main shell is bash, I would look at what the setting are for .bashrc and .bash_profile for root.
I believe this should shed some light on the subject. You might also want to google for bashrc bash_profile differences |
Quote:
The conventional solution to this issue is to define aliases in ~/.bashrc and source ~/.bashrc from within /etc/profile Code:
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi As grail suggested, the root discrepancy may lie in specifics of root's bash startup files or you may be running a login shell when starting a terminal session for root (a very Good Thing for security). Documentation on bash startup files here. |
.bashrc file with ls alias definition is placed in root's home directory indeed. Hmmm... I can't even remember when I placed it there. But if alias definition is commented in this file colorization don't work in root's screen too. I've copied root's .bashrc to my home directory. First it didn't resolve my problem. It was needed to define shell as /bin/bash for my user obviously. Before that default shell (/bin/sh) was used for my user. I have no idea why .bashrc wasn't used in this case because /bin/sh is symlink linked to /bin/bash. Nevertheless after I had defined shell for my user in /etc/passwd colorization came to be worked in screen.
|
All times are GMT -5. The time now is 05:19 AM. |