]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-122765: make prompt in activate.csh robust against unbalanced quotes and newlines...
authorJacek <jacek.duszenko@gmail.com>
Tue, 17 Sep 2024 17:16:43 +0000 (19:16 +0200)
committerGitHub <noreply@github.com>
Tue, 17 Sep 2024 17:16:43 +0000 (17:16 +0000)
Lib/venv/scripts/posix/activate.csh
Misc/NEWS.d/next/Library/2024-09-06-00-00-43.gh-issue-122765.tx4hsr.rst [new file with mode: 0644]

index c707f1988b0acc22a55b528a206b99aa45e68c54..b5db4a0f847e06c931ba64d24570ef417d93e2ce 100644 (file)
@@ -19,7 +19,7 @@ setenv VIRTUAL_ENV_PROMPT "__VENV_PROMPT__"
 set _OLD_VIRTUAL_PROMPT="$prompt"
 
 if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
-    set prompt = "(__VENV_PROMPT__) $prompt"
+    set prompt = "(__VENV_PROMPT__) $prompt:q"
 endif
 
 alias pydoc python -m pydoc
diff --git a/Misc/NEWS.d/next/Library/2024-09-06-00-00-43.gh-issue-122765.tx4hsr.rst b/Misc/NEWS.d/next/Library/2024-09-06-00-00-43.gh-issue-122765.tx4hsr.rst
new file mode 100644 (file)
index 0000000..8a1bc4b
--- /dev/null
@@ -0,0 +1 @@
+Fix unbalanced quote errors occurring when activate.csh in :mod:`venv` was sourced with a custom prompt containing unpaired quotes or newlines.