Skip to content

Commit 1b36af1

Browse files
committed
Ensure process buffer created for start-pythonic remote interpreter.
1 parent be82f47 commit 1b36af1

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

pythonic.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ necessary. SENTINEL must be a symbol of process sentinel
198198
function if necessary. QUERY-ON-EXIT will be corresponding
199199
process flag."
200200
(let ((default-directory (pythonic-default-directory cwd))
201-
(process-environment (copy-sequence process-environment)))
201+
(process-environment (copy-sequence process-environment))
202+
(buffer (and buffer (get-buffer-create buffer))))
202203
(pythonic-set-process-environment)
203204
(let ((process (apply 'start-file-process process buffer (pythonic-executable) args)))
204205
(when filter

test/pythonic-test.el

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,23 @@ remote host."
306306
(should (process-query-on-exit-flag
307307
(start-pythonic :process "out" :args '("-V") :query-on-exit t))))
308308

309+
(ert-deftest test-start-pythonic-keep-serviceable-tramp-connection ()
310+
"It is possible to work with remote host (use `find-file' for
311+
example) after we start pythonic process."
312+
(unwind-protect
313+
(let* ((python-shell-interpreter "/ssh:test@localhost:/usr/bin/python")
314+
(buffer (generate-new-buffer-name "*out*"))
315+
(process (start-pythonic :process "out"
316+
:buffer buffer
317+
:args '("-c" "raise SystemExit(1)"))))
318+
(while (process-live-p process)
319+
(accept-process-output process))
320+
(find-file "/ssh:test@localhost:/home/test/x.py")
321+
(should (get-buffer "x.py")))
322+
(kill-buffer "*tramp/ssh test@localhost*")
323+
(setq tramp-current-connection)
324+
(sleep-for 0.5)))
325+
309326
;;; Proper process environment detection.
310327

311328
(ert-deftest test-start-pythonic-path-property ()

0 commit comments

Comments
 (0)