Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bash_kernel/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ def _start_bash(self):
bashrc = os.path.join(os.path.dirname(pexpect.__file__), 'bashrc.sh')
child = pexpect.spawn("bash", ['--rcfile', bashrc], echo=False,
encoding='utf-8', codec_errors='replace')
# pexpect sleeps for delaybeforesend milliseconds (default 50)
# before every send, and run_command submits a cell one line at a
# time, so this adds ~50ms per line -- multiple seconds for a large
# cell. We only ever send just after seeing a prompt, so the delay
# (which guards against a TTY echo race -- see pexpect's rationale)
# is redundant here.
# https://github.com/pexpect/pexpect/blob/aa989594e1e413f45c18b26ded1783f7d5990fe5/pexpect/pty_spawn.py#L136-L150
child.delaybeforesend = 0
# Following comment stolen from upstream's REPLWrap:
# If the user runs 'env', the value of PS1 will be in the output. To avoid
# replwrap seeing that as the next prompt, we'll embed the marker characters
Expand Down