-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default bash environment setup only configures interactive shells #1447
Comments
Agreed, it's not very convenient (whenever I try to run emacs from my window manager rather than from the shell, it'll complain about not finding ocp-indent stuff)... However, shell startup configuration is a bit of a mess and we need to be very careful in this area: there is already some history, see #533. For example, it seems we should be very careful with adding a |
Is |
It should :) |
Right now,
opam init -a --bash
(well, not exactly,--bash
doesn't exist) writes to~/.bashrc
if~/.bash_profile
doesn't exist. If the shell is unknown,~/.profile
is used.The fundamental difference between
~/.bashrc
and~/.bash_profile
/~/.profile
is that the latter are run for all login shells whereas the former is run for interactive shells. The profile files usually execute~/.bashrc
but~/.bashrc
containsusually near the top. Because
opam
appends its session configuration to the end of the interactive shell initialization, only interactive sessions are configured for opam.This is painful when trying to use opam binaries via ssh like
ssh host "bash -l -c \"ocamlfind list\""
If
~/.bash_profile
does not exist, should opam just create it? If~/.profile
exists, should opam just append its configuration to that?Configuring for only interactive shells by default seems a little broken.
The text was updated successfully, but these errors were encountered: