Solved sysutils/screen: Aliases disabled?

Mayhem30

Well-Known Member

Reaction score: 19
Messages: 392

I'm not able to access any of my bash aliases when using sysutils/screen. Do I need to move them to a different file, or is there a config setting I need to use?

My bash aliases currently reside in my /home/.bash_profile file.

Screen is using bash as a shell.
Code:
[localhost ~]$ screen

GNU Screen version 4.06.02 (GNU) 23-Oct-17
...
...
[localhost]$ echo $SHELL
/usr/local/bin/bash
[localhost]$ alias
[localhost]$
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,886
Messages: 31,157

By default screen(1) will use whatever shell is set on the user's account. If you explicitly set it in ~/.screenrc the shell can be run as a login shell (runs ~/.bash_profile on startup) or not (runs ~/.bashrc on startup).
 
OP
OP
M

Mayhem30

Well-Known Member

Reaction score: 19
Messages: 392

Ok, how do I set ~/.screenrc so it runs ~/.bash_profile on startup?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,886
Messages: 31,157

Code:
       shell command

       Set  the	 command to be used to create a	new shell.  This overrides the
       value of	the environment	variable $SHELL.  This is useful if you'd like
       to  run a tty-enhancer which is expecting to execute the	program	speci-
       fied in $SHELL. [b]If the command begins with a '-'	character,  the	 shell
       will be started as a login-shell[/b].
 
OP
OP
M

Mayhem30

Well-Known Member

Reaction score: 19
Messages: 392

Thank you, I noticed all the following examples work. Should I be using any specific one?
Code:
shell -bash
shell -$SHELL
defshell -bash
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,886
Messages: 31,157

Best is probably not to define it so it automatically uses whatever shell your account it set to.
 
Top