help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

`comint-redirect-send-command' causes the shell prompt to be printed twi


From: Hongyi Zhao
Subject: `comint-redirect-send-command' causes the shell prompt to be printed twice.
Date: Mon, 14 Feb 2022 12:37:07 +0800

On Ubuntu 20.04.3 LTS, I'm using the self-compiled git master Emacs,
and installed comint-mime package as follows:

```
(use-package comint-mime
  :straight ( :host github
          :repo "astoff/comint-mime"
          :files (:defaults "*.py" "*.sh"))
  ;;https://github.com/jwiegley/use-package#hooks
  ;;https://github.com/astoff/comint-mime#usage
  
;;https://mail.google.com/mail/u/0?ik=7b73d6af10&view=om&permmsgid=msg-a%3Ar-1233702610310931433
  
;;https://mail.google.com/mail/u/0?ik=7b73d6af10&view=om&permmsgid=msg-a%3Ar5550893479419332762
  :hook ((shell-mode inferior-python-mode) . comint-mime-setup)
  :custom
  ;;  https://emacs.stackexchange.com/a/33992
  ;;https://github.com/astoff/comint-mime/issues/4#issuecomment-938384059
  (org-format-latex-options '(plist-put org-format-latex-options :scale 1.5))
  )
```

But the following code snippet in used in comint-mime package [1]:

```
(comint-redirect-send-command
(format " . %s\n" (shell-quote-argument
(expand-file-name "comint-mime.sh"
comint-mime-setup-script-dir)))
nil nil t)))
```

And the above code will causes the shell prompt to be printed twice
when I issue `M-x shell RET`, as shown here [2]. I filed an issue to
report this problem on this package's GitHub repository [3], but the
developer also don't know how to solve this problem. Here is the
author's description in the above-mentioned issue:

```
Yes, this happens intermittently for me as well. It's because of this call:

comint-mime/comint-mime.el

Lines 225 to 229 in 1431605

(comint-redirect-send-command
(format " . %s\n" (shell-quote-argument
(expand-file-name "comint-mime.sh"
comint-mime-setup-script-dir)))
nil nil t)))

I'm not quite sure what to do about this, since
comint-redirect-send-command is not supposed to print any output. In
any case, the extra prompt annoying but doesn't do any harm.
```

Therefore, I'm here for help to see if there is any solution.

[1] 
https://github.com/astoff/comint-mime/blob/1431605940724318c403a6048049c6a32cc16b0e/comint-mime.el#L225-L229
[2] 
https://user-images.githubusercontent.com/11155854/151753652-5aa63368-dc38-4905-851d-0367984f3c80.png
[3] https://github.com/astoff/comint-mime/issues/12

Regards,
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



reply via email to

[Prev in Thread] Current Thread [Next in Thread]