Skip to content

Commit

Permalink
Fixes for modern readline
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kdm9 authored May 24, 2022
1 parent 68c922d commit 9259532
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bash_kernel/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ def _start_bash(self):

# Register Bash function to write image data to temporary file
self.bashwrapper.run_command(image_setup_cmd)
# Set TERM_PROGRAM and TERM_PROGAM_VERSION. See https://github.com/takluyver/bash_kernel/issues/117#issuecomment-1032738154
self.bashwrapper.run_command(f"export TERM_PROGRAM='jupyter_bash_kernel'; export TERM_PROGRAM_VERSION='{__version__}';")
# Disable bracketed paste (see https://github.com/takluyver/bash_kernel/issues/117)
self.bashwrapper.run_command("(bind 'set enable-bracketed-paste off' || true) >/dev/null 2>&1")

def process_output(self, output):
if not self.silent:
Expand Down

0 comments on commit 9259532

Please sign in to comment.