You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ask for user input in my .bashrc, because I need to have different environnement variables in different context. It cause the bash_kernel to repeatidly crash, due to timeout like in issue #71.
# Placing an environnement variable to avoid the .bashrc asking for user input
export no_user_input="True"
# Different platforms have different names for the systemwide bashrc
if [[ -f /etc/bashrc ]]; then
source /etc/bashrc
fi
if [[ -f /etc/bash.bashrc ]]; then
source /etc/bash.bashrc
fi
if [[ -f ~/.bashrc ]]; then
source ~/.bashrc
fi
# Reset PS1 so pexpect can find it
PS1="$"
# Unset PROMPT_COMMAND, so that it can't change PS1 to something unexpected.
unset PROMPT_COMMAND
I set the no_user_input environnement variable and then detect this variable in my .bashrc to supress the query for user input
Cleaner solution
Is there a best solution ? Does pexpect already set a variable I may use for my test ?
The text was updated successfully, but these errors were encountered:
I can't think of anything already set that you could detect for this. Part of the what Pexpect does is tricking programs into using their 'interactive mode', either for testing or for automating awkward programs.
I'd be open to bash_kernel setting something like JUPYTER_BASH_KERNEL=1 so that things run from bash can detect it.
(I've also wanted some standard environment variable to tell all programs not to wait for user input, e.g. when running apt-get install from a dockerfile. But I don't know of anything like that.)
Issue
I ask for user input in my .bashrc, because I need to have different environnement variables in different context. It cause the bash_kernel to repeatidly crash, due to timeout like in issue #71.
My solution
Based on @takluyver answer to the issue I modified - pexpect/pexpect#459 the following way:
I set the no_user_input environnement variable and then detect this variable in my .bashrc to supress the query for user input
Cleaner solution
Is there a best solution ? Does pexpect already set a variable I may use for my test ?
The text was updated successfully, but these errors were encountered: