unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: `comint-redirect-send-command' causes the shell prompt to be printed twice.
Date: Mon, 14 Feb 2022 12:37:07 +0800	[thread overview]
Message-ID: <CAGP6POLC3w0OPy8J45TDi30CSm=VzxdSBQ-bVpPiVdB2zBRY3A@mail.gmail.com> (raw)

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	other threads:[~2022-02-14  4:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14  4:37 Hongyi Zhao [this message]
2022-02-14  5:02 ` `comint-redirect-send-command' causes the shell prompt to be printed twice Emanuel Berg via Users list for the GNU Emacs text editor
2022-02-14  5:07 ` Emanuel Berg via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGP6POLC3w0OPy8J45TDi30CSm=VzxdSBQ-bVpPiVdB2zBRY3A@mail.gmail.com' \
    --to=hongyi.zhao@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).