From 04b3a01b712e263dc1eecb9dfab08c3c9a15cf24 Mon Sep 17 00:00:00 2001 From: Miro <200482516+Mirochill@users.noreply.github.com> Date: Mon, 25 May 2026 21:56:54 +0200 Subject: [PATCH] Avoid VTE preexec prompt markers --- bash_kernel/install.py | 2 +- bash_kernel/kernel.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bash_kernel/install.py b/bash_kernel/install.py index 00bd86a..60af4d1 100644 --- a/bash_kernel/install.py +++ b/bash_kernel/install.py @@ -13,7 +13,7 @@ "display_name":"Bash", "language":"bash", "codemirror_mode":"shell", - "env":{"PS1": "$"} + "env":{"PS1": "$", "VTE_VERSION": ""} } def install_my_kernel_spec(user=True, prefix=None): diff --git a/bash_kernel/kernel.py b/bash_kernel/kernel.py index 3b9cf44..6ebc2f1 100644 --- a/bash_kernel/kernel.py +++ b/bash_kernel/kernel.py @@ -129,7 +129,9 @@ def _start_bash(self): # environment variable, but not when bash displays the prompt. ps1 = self.unique_prompt + u'\[\]' + ">" ps2 = self.unique_prompt + u'\[\]' + "+" - prompt_change = u"PS1='{0}' PS2='{1}' PROMPT_COMMAND=''".format(ps1, ps2) + prompt_change = ( + u"PS1='{0}' PS2='{1}' PS0='' PROMPT_COMMAND=''" + ).format(ps1, ps2) # Using IREPLWrapper to get incremental output self.bashwrapper = IREPLWrapper(child, u'\$', prompt_change, self.unique_prompt, extra_init_cmd="export PAGER=cat",