From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: `comint-redirect-send-command' causes the shell prompt to be printed twice. Date: Mon, 14 Feb 2022 12:37:07 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18101"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 14 05:37:53 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJT7Y-0004XJ-Ov for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 14 Feb 2022 05:37:52 +0100 Original-Received: from localhost ([::1]:46306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJT7X-0005pS-8c for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 13 Feb 2022 23:37:51 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJT74-0005pJ-CY for help-gnu-emacs@gnu.org; Sun, 13 Feb 2022 23:37:22 -0500 Original-Received: from [2607:f8b0:4864:20::a34] (port=38685 helo=mail-vk1-xa34.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJT71-00072d-UC for help-gnu-emacs@gnu.org; Sun, 13 Feb 2022 23:37:22 -0500 Original-Received: by mail-vk1-xa34.google.com with SMTP id d196so732123vke.5 for ; Sun, 13 Feb 2022 20:37:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=XRrC5S6XblDnnIGGV0+KC+1DJbgnsmq8+cpixD51rgw=; b=DW2QKieMGxyhclOxXam1BUdCQxUp3v8H3i/ONvpJuQmshMiDvQvq3orKAgNYHIE1gw 1tG5YvlgWPqgbKs5eqjPiNYxGExmxdlUZXYdXYmDw1fSc1/k2mB9OE8hHZLcn5b7mZAw RJkqAHDZRL1imlHjNEosSCgT7pg3+nAeW9RP4LJmov6pgO0gL+UZ2RqjW2HDR4XYcfH1 TI+33Z+ky7X8PvAGxDR5RY5AsRWFV/pd2pZz+1O3lrexi2RiOaQDnGhYVOnik1EY0EeM MXaRS8ZOQzAQ9zRbBRd9G7f56/onX64mtf4J22iCh5KY1R3nyRpfCalYwXm3ltD2/1p1 G39Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=XRrC5S6XblDnnIGGV0+KC+1DJbgnsmq8+cpixD51rgw=; b=WTVStUODl0YBIZEcXwPD/PUBYNoIySSnpQLSDRtZyGVKHH1DXOIhzFf5WdNNH0vrWF L4HNiNdp2ofLDoxqcbFBgpiwGidOk0EM5wKosfDItlcT6jgJOBg403iN5One+ttE524G fT5Ut9QneaZVXC0HDqDEm/M4RTL4wdkuI9Wivyxx9GAoNDJwWmDNPWt3z0afDhfE1PSS wmG+b3hRk7f7ofRP2jQixqfZShYbxCB+vMmzD4yWKmVgdBh5dpEvSkQk5zm7T7Rbz5RH 3LMLt2QrSy+GYq/L/L/xOdvCHrBJZVT2EiWwcGlF0LrBac0e124eeIM1kNqWW78Yt6kR tERQ== X-Gm-Message-State: AOAM530SW6Uy2BfPPU4VnT6oKy+1ihMVNNOazhhrZrksm6mjkEZ3d/jm rDc+J1rUTYJDa0ghLCwkZiydXpTiO3CLUMYxOi1tZRa/FJMEePuoW90= X-Google-Smtp-Source: ABdhPJyaKHfrTCkMQtuNbqfq7702dIBMlBElA7znF0t1TD34ONbUzK+f2Wu8HZIjJkPUL6gy8LfCY0kj+QlXVuETb9A= X-Received: by 2002:a05:6122:894:: with SMTP id 20mr3422930vkf.22.1644813438110; Sun, 13 Feb 2022 20:37:18 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::a34 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::a34; envelope-from=hongyi.zhao@gmail.com; helo=mail-vk1-xa34.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.785, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:135941 Archived-At: 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 Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province