Closed pbannister closed 5 years ago
I don't understand what you did. If you want to contribute code please make a pull request.
Closing if no reply
I removed this line from .bashrc and added to .profile:
source /home/pi/scripts/welcome
The bug is that you might not be aware of the difference. :)
Made this change as I was preparing to build Marlin, so as to update the firmware on the attached printer. Created a virtual (Python/development) environment, and to enter typed:
pipenv build-Marlin
... and saw the "Welcome" message, as though I had first logged in. WTF? This is not right ... subshells should not display login messages.
When I go to my other printer (w/o the change), and type bash then I get:
pi@octopi-2:~ $ bash
------------------------------------------------------------------------------
Access OctoPrint from a web browser on your network by navigating to any of:
http://octopi.local
http://192.168.86.23
https is also available, with a self-signed certificate.
------------------------------------------------------------------------------
This image comes without a desktop environment installed because it's not
required for running OctoPrint. If you want a desktop environment you can
install it via
sudo /home/pi/scripts/install-desktop
------------------------------------------------------------------------------
OctoPrint version : 1.3.8
OctoPi version : 0.14.0
------------------------------------------------------------------------------
pi@octopi-2:~ $
This is not what we want.
If you look at the INVOCATION section of the bash manpage, there are different startup files sourced by the shell, depending on how they are invoked. (This is old and common shell behavior.)
Things that should be done on login belong in .profile. The "Welcome" message belongs there.
Again - If you have something that needs to be fixed please send a pull request. I can't follow guides, that's why I built CustomPiOS
Closing if no reply
The bit of helpful text emitted by $HOME/scripts/welcome is currently invoked from ~/.bashrc rather than from ~/.profile. As the comments in each reflect, ".profile" is for login shells ... where you want to emit such notices.
I moved this line from .bashrc and added to .profile:
The reason for this is that if I were to (say) have scripts that send single-line SSH commands from another computer, I would not want the "Welcome" message in the output. For example:
(Without the change, the welcome message would appear ... not wanted.)