diff options
author | jao <jao@gnu.org> | 2021-01-09 01:14:52 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-01-09 01:14:52 +0000 |
commit | e84e1215bf07e6305eaabb9b3e059b406021d5d0 (patch) | |
tree | 24472ad87e8912c1407c5ad6f06b89e7802060d4 /prog | |
parent | 1228164acf5bd3afcda3ab0cba761adccf34c88c (diff) | |
download | elibs-e84e1215bf07e6305eaabb9b3e059b406021d5d0.tar.gz elibs-e84e1215bf07e6305eaabb9b3e059b406021d5d0.tar.bz2 |
vterm repl - multiple repls
Diffstat (limited to 'prog')
-rw-r--r-- | prog/jao-vterm-repl.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/prog/jao-vterm-repl.el b/prog/jao-vterm-repl.el index 7954bd0..699ff39 100644 --- a/prog/jao-vterm-repl.el +++ b/prog/jao-vterm-repl.el @@ -42,13 +42,15 @@ (defvar-local jao-vterm-repl--last-buffer nil) (defvar-local jao-vterm-repl--prompt-rx "^[0-9]+> ") +(setq vterm-buffer-name-string nil) + (defun jao-vterm-repl--exec (cmd &optional name) (vterm name) (when name (vterm-send-string "unset PROMPT_COMMAND\n\n")) (vterm-send-string cmd) (vterm-send-return) - (when name (rename-buffer name))) + (when name (rename-buffer name t))) ;;;###autoload (defun jao-vterm-repl-previous-prompt () @@ -91,8 +93,11 @@ (let ((default-directory dir) (prompt (cdr (assoc root-name jao-vterm-repl-prompts))) (cmd (or (cdr (assoc root-name jao-vterm-repl-repls)) - (read-string "REPL command: ")))) - (jao-vterm-repl--exec cmd (format "* vrepl - %s *" root-name)) + (read-string "REPL command: "))) + (bname (format "* vrepl - %s/%s *" + (file-name-base (string-remove-suffix "/" dir)) + root-name))) + (jao-vterm-repl--exec cmd bname) (jao-vterm-repl-mode) (setq-local jao-vterm-repl--name vname) (when prompt (setq-local jao-vterm-repl--prompt-rx prompt)) |