-
Notifications
You must be signed in to change notification settings - Fork 144
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
Running any cell (containing any shell command or function definition) always produces non-zero exit status (+workaround) #117
Comments
It seems like the interface between terminal emulator and shell is gradually expanding. There's no good way to detect bash_kernel at the moment. I mentioned on #111 that I'm happy if someone wants to add one, though:
I dislike this kind of 'detect what's running you' feature in general, but this is all kind of a bodge anyway. |
Well, my Emacs sets Setting
|
A little bit more on
|
Should address issues described in takluyver#117 et al. Additionally, I've added code to set the TERM_PROGRAM and TERM_PROGRAM_VERSION env vars so others can set variables accordingly. This *might* not be ideal, as perhaps bashrc has executed before these are set. Please advise if that's the case.
0.8 should fix this (thanks to PR #120). As a separate matter, I'm still open to setting some environment variable to indicate that it's bash_kernel outside the terminal. I'm a bit puzzled about TERM vs TERM_PROGRAM - my modern Linux system still doesn't seem to set TERM_PROGRAM automatically or use it, so I don't know if that's mostly an Apple thing or just randomly hasn't reached Fedora yet. 🤷 |
When I run any cell with Bash code in it with Bash kernel, it always returns a non-zero exit status.
The issue seems to be related to both issues #116, #115 and #107 as the workaround mentioned in those issues works for this one as well, but I haven't seen any garbled output so far.
In order to not have to include
bind 'set enable-bracketed-paste off'
at the beginning of each and every notebook using the Bash kernel, I've added the following kludgy hack to my~/.bashrc
for now:[[ $(< /proc/$PPID/comm) == python* ]] && bind 'set enable-bracketed-paste off'
This should apply the workaround to any interactive Bash shell running as a child process of a Python process (assuming that process to be the Bash kernel in most cases), and not to any other interactive shell.
@takluyver Is there a better way to detect if the shell process is running in the Bash kernel? Any advice is very welcome.
The text was updated successfully, but these errors were encountered: