use a pure python way to cd

This commit is contained in:
Valentin Boettcher 2024-05-11 16:31:51 -04:00
parent a7a603c24d
commit bf20984058
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE

View file

@ -339,7 +339,7 @@ This is equivalent to running `%run <buffer-file-name>` in the python vterm buff
(interactive) (interactive)
(if buffer-file-name (if buffer-file-name
(let ((buffer-directory (file-name-directory buffer-file-name))) (let ((buffer-directory (file-name-directory buffer-file-name)))
(python-vterm-paste-string (format "%%cd \"%s\"\n" buffer-directory)) (python-vterm-paste-string (format "import os; os.chdir(\"%s\")" buffer-directory))
(with-current-buffer (python-vterm-fellow-repl-buffer) (with-current-buffer (python-vterm-fellow-repl-buffer)
(setq default-directory buffer-directory))) (setq default-directory buffer-directory)))
(message "The buffer is not associated with a directory."))) (message "The buffer is not associated with a directory.")))