From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0L7XIG2XxWNtZAEAbAwnHQ (envelope-from ) for ; Mon, 16 Jan 2023 19:29:01 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id wEEVIG2XxWPAjQAAG6o9tA (envelope-from ) for ; Mon, 16 Jan 2023 19:29:01 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 13A153CA47 for ; Mon, 16 Jan 2023 19:29:00 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHUDL-0003TN-3u; Mon, 16 Jan 2023 13:28:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHUDJ-0003T7-2Q for emacs-orgmode@gnu.org; Mon, 16 Jan 2023 13:28:09 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHUDG-0007m7-0H for emacs-orgmode@gnu.org; Mon, 16 Jan 2023 13:28:08 -0500 Received: by mail-pj1-x102c.google.com with SMTP id q5so3720761pjh.1 for ; Mon, 16 Jan 2023 10:28:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=cuxa4Xu/r7jxxIy8wYaQtJv1UB5vIXf/SSh1GWm6Aa8=; b=H+o59vD6WUH/SES0Homi/mWywEdIhs39MGfMmtvB0tGCvkDofiO4p4GgKmuaGT65/9 I48wHlyvjTgavo7d3DUIvePuksoCGT2PGLjTvr1L7uHcT8SquT1fGyuIvGPCV5qdT8v+ OJTgkR3h856a+2DRpXyGFIcEA5AAipDD/lSLBlCCLK+xSnV1zgi6II9ZSgBqFpAeQ2LC ozLdXdaXpGxnZoZN2iAHqoJ+4hfxCFOK18lJHTVrg4Sk84GNZ2EInd6hkxxDMqNzJwlv Ygbm6UxxYUGDJH7XxS4L6mgxdmHsyICCWjQM/nw+FyywQb2MDk9WmqQZbyCxsPpFoKIP vO/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cuxa4Xu/r7jxxIy8wYaQtJv1UB5vIXf/SSh1GWm6Aa8=; b=eBRWD0fCWwqPic6ChwkrS2UpVSprxVkQzgZpoQZr7TSOdbG2m1MiF83LVP3aMZ4neK gx4TInXzAANKgskSgjvnZwTInMvBzqTEBbk85yRaXyuWMeVBXIsaTawC2sxBMdhvu0jY qZQSkm5xxgRA3OmQr/wFTs4lcOTfbm1ZNBqxHzjaR4EZE8dY7qGQuKIWjS4bfVjK0d5d OhYFvMHwN28YVH+IK+4fnuAWIKIeMTdkqWoAT/5QK3z7+laeHfblwR/j1v4SmzyWx/Cc VvikmkUnkWOiNDPpdghg0vSh4IrEgjkP5T1gsdel6e/cbZNB3HL60k0EKxNVpF/c1TqC 2rIA== X-Gm-Message-State: AFqh2kopNkkeZjm4y9R++De6FaC8SEwkjrC9gGlfoOB1jnRxya0mJ1vK nHmRffury3U7sOnJwgPV8egQaYsYfn9nJDCmf6a55dbgccQ= X-Google-Smtp-Source: AMrXdXtPrQ+PYZhRiPQWuXHKZx2UkK094n818oKSV98YdzUeWkU0+ZdDQq1DTNjbXIzT11LhUp11DTmSVg6s8SoyIkE= X-Received: by 2002:a17:90a:5144:b0:229:5446:ed0 with SMTP id k4-20020a17090a514400b0022954460ed0mr12958pjm.209.1673893683669; Mon, 16 Jan 2023 10:28:03 -0800 (PST) MIME-Version: 1.0 From: Osher Jacob Date: Mon, 16 Jan 2023 18:27:52 +0200 Message-ID: Subject: [BUG] ob-shell doesn't evaluate last line on Windows (cmd/cmdproxy) [9.6.1 ( @ c:/Users/Osher/AppData/Roaming/.emacs.d/elpa/org-9.6.1/)] To: emacs-orgmode@gnu.org Content-Type: multipart/mixed; boundary="000000000000684a4205f265befa" Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=osherz5@gmail.com; helo=mail-pj1-x102c.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673893741; a=rsa-sha256; cv=none; b=aereH+b8cpq/3UJESmycWYsjo5XdRY+tqUbwosx3v9q21MlK6bv1UN8VX6KjnnMs0fTWCQ FlwGdtaoCaadDFGEULPPiVvVXFEDw9LO2cuv76v1F/Cv9FwiP3rSveD4vkVlJlxcY7Vm35 IeCU/XCgAwqgghkCbzSTpp/+MM43YEkB1d+oaXMBPDzQW/HsnB7s0uwfOcMwzupbYGlkAM zjnWL2XLrhB2IB+HJRIkohqrSe1tkbSZpt3CYTqDq99hMIzImc+V2w73jWsxYWH8RWJzIW Vea7LJ1B9g7z5HYt4IDpH3w0Tol6KwBVTFn5XNaZxspazo/nnxmt1ZEL6XyQ0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=H+o59vD6; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673893741; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=6WyUlril7roIniSoIjbptIa30v96wUYi1xGjMTn+e4A=; b=rzKfMShHju/e2bk6WYRR3uhvsCJQa9foMALUUlLyl1eXZpQBDj1/Pu3RTInPgCyC2lK8vp TYGEt+mINd96KduoTucDkTNAhxk2rVK8sNGv2mZ/X+wl7HZf1nqymXFbbshQSeaUYT9Jkw XV0Q8+3EbAAZD0vdA0aMPc0g3NsKKiyJ9oxCp32lm/Q3eiESyrN52NiJ1mqN+atVXxsEg+ ci0+JXP67u+8Qqpcb/BiaP8JhLNwqDsicfzBgK9HFfkXXOBLOC9cdxQ2Xylnab3EqMtPCQ yt762BSkV7xIA85P50MKjtM69covD9uU4Y/0pyHV/aOgHwlAvsQOaN3RX811oQ== X-Migadu-Spam-Score: -0.33 X-Spam-Score: -0.33 X-Migadu-Queue-Id: 13A153CA47 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=H+o59vD6; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) X-TUID: IltZuJEF+ioP --000000000000684a4205f265befa Content-Type: multipart/alternative; boundary="000000000000684a3f05f265bef8" --000000000000684a3f05f265bef8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable *Expected behaviour:*On Windows, all lines of the babel shell block should be evaluated, with full output printed. *Actual behaviour:*All lines but the last are evaluated, the output ends with 'More?' instead of the last command's output. *Steps to reproduce:*In Windows, start a clean Emacs instance (I used "runemacs.exe -Q"), and evaluate the following blocks: 1) Enable shell language support #+begin_src elisp (org-babel-do-load-languages 'org-babel-load-languages '( (shell . t) ) ) #+end_src #+RESULTS: 2) Evaluate this shell code block #+begin_src shell echo 1 echo 2 #+end_src #+RESULTS: | Microsoft | Windows | [Version | 10.0.19044.2364] | | | | (c) | Microsoft | Corporation. | All | rights | reserved. | | | | | | | | | c:\Users\osherj>echo | 1 | | | | | | 1 | | | | | | | | | | | | | | c:\Users\osherj>More? | | | | | | *Additional info:*After some debugging, it seems to be caused by a missing newline character at the end of the code block content. I believe this is caused by the org-trim function which is called upon the body of the block. At the function: org/ob-shell.el -> (defun org-babel-sh-evaluate ...) The line: (org-babel-eval shell-file-name (org-trim body)) *Suggested fix:*The hacky way I solved it was to change this line: (t (org-babel-eval shell-file-name (org-trim body)))))) to this: (t (org-babel-eval shell-file-name (concat (org-trim body) "\n")))))) Also attached as a patch file Let me know if there's any other information you need, or if I can help in any other way. Thanks! Osher Emacs : GNU Emacs 28.2 (build 2, x86_64-w64-mingw32) of 2022-09-13 Package: Org mode version 9.6.1 ( @ c:/Users/Osher/AppData/Roaming/.emacs.d/elpa/org-9.6.1/) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq org-link-elisp-confirm-function 'yes-or-no-p org-format-latex-header "\\documentclass{article}\n\\usepackage[usenames]{color}\n[PACKAGES]\n[DEFA= ULT-PACKAGES]\n\\pagestyle{empty} % do not remove\n% The settings below are copied from fullpage.sty\n\\setlength{\\textwidth}{\\paperwidth}\n\\addtolength{\\textw= idth}{-3cm}\n\\setlength{\\oddsidemargin}{1.5cm}\n\\addtolength{\\oddsidema= rgin}{-2.54cm}\n\\setlength{\\evensidemargin}{\\oddsidemargin}\n\\setlength= {\\textheight}{\\paperheight}\n\\addtolength{\\textheight}{-\\headheight}\n= \\addtolength{\\textheight}{-\\headsep}\n\\addtolength{\\textheight}{-\\foo= tskip}\n\\addtolength{\\textheight}{-3cm}\n\\setlength{\\topmargin}{1.5cm}\= n\\addtolength{\\topmargin}{-2.54cm}" org-bibtex-headline-format-function '(closure (org-id-locations org-agenda-search-view-always-boolean org-agenda-overriding-header t) (entry) (cdr (assq :title entry))) org-persist-after-read-hook '(org-element--cache-persist-after-read) org-time-stamp-custom-formats '("<%m/%d/%y %a>" . "<%m/%d/%y %a %H:%M>") org-export-before-parsing-hook '(org-attach-expand-links) org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-archive-hook '(org-attach-archive-delete-maybe) org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function org-ascii-format-drawer-function '(closure (t) (_name contents _width) contents) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-persist-before-read-hook '(org-element--cache-persist-before-read) org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-fold-show-all append local] 5] (closure (org--rds reftex-docstruct-symbol org--single-lines-list-is-paragraph visual-fill-column-width org-clock-history org-agenda-current-date org-with-time org-defdecode org-def org-read-date-inactive org-ans2 org-ans1 org-columns-current-fmt-compiled org-clock-current-task org-clock-effort org-agenda-skip-function org-agenda-skip-comment-trees org-agenda-archives-mode org-end-time-was-given org-time-was-given org-blocked-by-checkboxes org-state org-agenda-headline-snapshot-before-repeat org-agenda-buffer-name org-agenda-start-on-weekday org-agenda-buffer-tmp-name buffer-face-mode-face org-struct-menu org-last-state org-clock-start-time texmathp-why remember-data-file org-agenda-tags-todo-honor-ignore-options calc-embedded-open-mode calc-embedded-open-formula calc-embedded-close-formula align-mode-rules-list org-export-registered-backends crm-separator org-id-overriding-file-name org-indent-indentation-per-level org-element--timestamp-regexp org-element-cache-map-continue-from org-element-paragraph-separate org-agenda-buffer-name org-inlinetask-min-level t) nil (add-hook 'change-major-mode-hook 'org-fold-show-all 'append 'local)) (closure (*this* org-babel-confirm-evaluate-answer-no t) nil (add-hook 'change-major-mode-hook #'org-babel-show-result-all 'append 'local)) #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-all append local] 5] #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-babel-load-languages '((shell . t)) org-latex-format-drawer-function '(closure (engrave-faces-latex-mathescape engrave-faces-current-preset-style engrave-faces-latex-output-style t) (_ contents) contents) org-latex-format-headline-function 'org-latex-format-headline-default-function org-confirm-shell-link-function 'yes-or-no-p org-html-format-drawer-function '(closure (htmlize-buffer-places org-html-format-table-no-css htmlize-css-name-prefix htmlize-output-type htmlize-output-type htmlize-css-name-prefix t) (_name contents) contents) outline-isearch-open-invisible-function 'outline-isearch-open-invisible org-fold-catch-invisible-edits nil org-odt-format-headline-function 'org-odt-format-headline-default-function org-agenda-before-write-hook '(org-agenda-add-entry-text) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-confirm-elisp-link-function 'yes-or-no-p org-preview-latex-process-alist '((dvipng :programs ("latex" "dvipng") :description "dvi > png" :message "you need to install the programs: latex and dvipng." :image-input-type "dvi" :image-output-type "png" :image-size-adjust (1.0 . 1.0) :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") :image-converter ("dvipng -D %D -T tight -bg Transparent -o %O %f")) (dvisvgm :programs ("latex" "dvisvgm") :description "dvi > svg" :message "you need to install the programs: latex and dvisvgm." :image-input-type "dvi" :image-output-type "svg" :image-size-adjust (1.7 . 1.5) :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") :image-converter ("dvisvgm %f -n -b min -c %S -o %O")) (imagemagick :programs ("latex" "convert") :description "pdf > png" :message "you need to install the programs: latex and imagemagick." :image-input-type "pdf" :image-output-type "png" :image-size-adjust (1.0 . 1.0) :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f") :image-converter ("convert -density %D -trim -antialias %f -quality 100 %O")) ) org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default org-odt-format-drawer-function '(closure (hfy-user-sheet-assoc hfy-html-quote-regex hfy-html-quote-map hfy-face-to-css hfy-begin-span-handler hfy-end-span-handler nxml-auto-insert-xml-declaration-flag t) (_name contents) contents) org-persist-directory "c:/Users/Osher/AppData/Local/Temp/org-persist-bvcjPn" org-babel-exp-code-template "#+BEGIN_SRC %lang%switches%flags\n%body\n#+END_SRC" org-fold-core-isearch-open-function 'org-fold--isearch-reveal org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function org-persist-before-write-hook '(org-element--cache-persist-before-write) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-link-shell-confirm-function 'yes-or-no-p org-babel-pre-tangle-hook '(save-buffer) org-agenda-loop-over-headlines-in-active-region nil org-occur-hook '(org-first-headline-recenter) org-metadown-hook '(org-babel-pop-to-session-maybe) org-link-parameters '(("attachment" :follow org-attach-follow :complete org-attach-complete-link) ("id" :follow org-id-open) ("eww" :follow org-eww-open :store org-eww-store-link) ("rmail" :follow org-rmail-open :store org-rmail-store-link) ("mhe" :follow org-mhe-open :store org-mhe-store-link) ("irc" :follow org-irc-visit :store org-irc-store-link :export org-irc-export) ("info" :follow org-info-open :export org-info-export :store org-info-store-link :insert-description org-info-description-as-command) ("gnus" :follow org-gnus-open :store org-gnus-store-link) ("docview" :follow org-docview-open :export org-docview-export :store org-docview-store-link) ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link) ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete org-bbdb-complete-link :store org-bbdb-store-link) ("w3m" :store org-w3m-store-link) ("doi" :follow org-link-doi-open :export org-link-doi-export) ("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell) ("news" :follow #[514 "\301\300\302 Q \"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("mailto" :follow #[514 "\301\300\302 Q \"\207" ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("https" :follow #[514 "\301\300\302 Q \"\207" ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("http" :follow #[514 "\301\300\302 Q \"\207" ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("ftp" :follow #[514 "\301\300\302 Q \"\207" ["ftp" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("help" :follow org-link--open-help :store org-link--store-help) ("file" :complete org-link-complete-file) ("elisp" :follow org-link--open-elisp)) org-html-format-headline-function 'org-html-format-headline-default-function org-metaup-hook '(org-babel-load-in-session-maybe) org-src-lang-modes '(("C" . c) ("C++" . c++) ("asymptote" . asy) ("bash" . sh) ("beamer" . latex) ("calc" . fundamental) ("cpp" . c++) ("ditaa" . artist) ("dot" . fundamental) ("elisp" . emacs-lisp) ("ocaml" . tuareg) ("screen" . shell-script) ("shell" . sh) ("sqlite" . sql)) ) --000000000000684a3f05f265bef8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Expected behaviour:
On Windows, all lines of the= babel shell block should be evaluated, with full output printed.

Actual behaviour:
All lines but the last are evaluated, the output = ends with 'More?'
instead of the last command's output.
<= br>Steps to reproduce:
In Windows, start a clean Emacs instance (= I used "runemacs.exe -Q"), and evaluate the following blocks:
=
1) Enable shell language support
#+begin_src elisp
(org-babel-do-= load-languages
=C2=A0 =C2=A0'org-babel-load-languages
=C2=A0 =C2= =A0'(
=C2=A0 =C2=A0 =C2=A0(shell . t)
=C2=A0 =C2=A0 =C2=A0)
= =C2=A0 =C2=A0)
#+end_src

#+RESULTS:


2) Evaluate this s= hell code block
#+begin_src shell
=C2=A0 echo 1
=C2=A0 echo 2
<= br>
#+end_src

#+RESULTS:
| Microsoft =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 | Windows =C2=A0 | [Version =C2=A0 =C2=A0 | 10.0.19044.23= 64] | =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
= | (c) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | Micr= osoft | Corporation. | All =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= | rights | reserved. |
| =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 |
| c:\Users\osherj>echo =C2=A0| 1 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2= =A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| 1 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2= =A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 = =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| c:\Users\os= herj>More? | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 |


Additional info:
After some debugging, it se= ems to be caused by a missing newline character at the
end of the code b= lock content.
I believe this is caused by the org-trim function which is= called upon the body of the block.
At the function:
org/ob-shell.el = -> (defun org-babel-sh-evaluate ...)
The line:
(org-babel-eval she= ll-file-name (org-trim body))


Suggested fix:
The hacky= way I solved it was to change this line:
(t (org-babel-eval shell-file-= name (org-trim body))))))
to this:
(t (org-babel-eval shell-file-name= (concat (org-trim body) "\n"))))))
Also attached as a patch f= ile


Let me know if there's any other inform= ation you need, or if I can help in any other way.

Thanks!
Osher<= br>

Emacs =C2=A0: GNU Emacs 28.2 (build 2, x86_64-w64-mingw32)
= =C2=A0of 2022-09-13
Package: Org mode version 9.6.1 ( @ c:/Users/Osher/A= ppData/Roaming/.emacs.d/elpa/org-9.6.1/)

current state:
=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(setq
=C2=A0org-link-elisp-confirm-= function 'yes-or-no-p
=C2=A0org-format-latex-header "\\document= class{article}\n\\usepackage[usenames]{color}\n[PACKAGES]\n[DEFAULT-PACKAGE= S]\n\\pagestyle{empty} =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 % do not r= emove\n% The settings below are copied from fullpage.sty\n\\setlength{\\tex= twidth}{\\paperwidth}\n\\addtolength{\\textwidth}{-3cm}\n\\setlength{\\odds= idemargin}{1.5cm}\n\\addtolength{\\oddsidemargin}{-2.54cm}\n\\setlength{\\e= vensidemargin}{\\oddsidemargin}\n\\setlength{\\textheight}{\\paperheight}\n= \\addtolength{\\textheight}{-\\headheight}\n\\addtolength{\\textheight}{-\\= headsep}\n\\addtolength{\\textheight}{-\\footskip}\n\\addtolength{\\texthei= ght}{-3cm}\n\\setlength{\\topmargin}{1.5cm}\n\\addtolength{\\topmargin}{-2.= 54cm}"
=C2=A0org-bibtex-headline-format-function '(closure (org= -id-locations org-agenda-search-view-always-boolean org-agenda-overriding-h= eader t) (entry)
=C2=A0 =C2=A0 =C2=A0 (cdr (assq :title entry)))=C2=A0org-persist-after-read-hook '(org-element--cache-persist-after-r= ead)
=C2=A0org-time-stamp-custom-formats '("<%m/%d/%y %a>= " . "<%m/%d/%y %a %H:%M>")
=C2=A0org-export-before-= parsing-hook '(org-attach-expand-links)
=C2=A0org-cycle-tab-first-ho= ok '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)=C2=A0org-archive-hook '(org-attach-archive-delete-maybe)
=C2=A0org= -odt-format-inlinetask-function 'org-odt-format-inlinetask-default-func= tion
=C2=A0org-ascii-format-drawer-function '(closure (t) (_name con= tents _width) contents)
=C2=A0org-cycle-hook '(org-cycle-hide-archiv= ed-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-= window-after-visibility-change)
=C2=A0org-persist-before-read-hook '= (org-element--cache-persist-before-read)
=C2=A0org-mode-hook '(#[0 &= quot;\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-f= old-show-all append local] 5]
(closure
=C2=A0(org--rds reftex-d= ocstruct-symbol org--single-lines-list-is-paragraph visual-fill-column-widt= h org-clock-history
=C2=A0 org-agenda-current-date org-with-time org-= defdecode org-def org-read-date-inactive org-ans2 org-ans1 org-columns-curr= ent-fmt-compiled
=C2=A0 org-clock-current-task org-clock-effort org-a= genda-skip-function org-agenda-skip-comment-trees org-agenda-archives-mode<= br> =C2=A0 org-end-time-was-given org-time-was-given org-blocked-by-check= boxes org-state org-agenda-headline-snapshot-before-repeat
=C2=A0 org= -agenda-buffer-name org-agenda-start-on-weekday org-agenda-buffer-tmp-name = buffer-face-mode-face org-struct-menu org-last-state
=C2=A0 org-clock= -start-time texmathp-why remember-data-file org-agenda-tags-todo-honor-igno= re-options calc-embedded-open-mode
=C2=A0 calc-embedded-open-formula = calc-embedded-close-formula align-mode-rules-list org-export-registered-bac= kends crm-separator
=C2=A0 org-id-overriding-file-name org-indent-ind= entation-per-level org-element--timestamp-regexp org-element-cache-map-cont= inue-from
=C2=A0 org-element-paragraph-separate org-agenda-buffer-nam= e org-inlinetask-min-level t)
=C2=A0nil (add-hook 'change-major-m= ode-hook 'org-fold-show-all 'append 'local))
(closure (*t= his* org-babel-confirm-evaluate-answer-no t) nil
=C2=A0(add-hook '= ;change-major-mode-hook #'org-babel-show-result-all 'append 'lo= cal))
#[0 "\300\301\302\303\304$\207" [add-hook change-majo= r-mode-hook org-show-all append local] 5]
#[0 "\300\301\302\303\= 304$\207" [add-hook change-major-mode-hook org-babel-show-result-all a= ppend local] 5] org-babel-result-hide-spec
org-babel-hide-all-hashes)=
=C2=A0org-babel-load-languages '((shell . t))
=C2=A0org-latex-fo= rmat-drawer-function '(closure (engrave-faces-latex-mathescape engrave-= faces-current-preset-style engrave-faces-latex-output-style t)
=C2= =A0 =C2=A0(_ contents) contents)
=C2=A0org-latex-format-headline-functio= n 'org-latex-format-headline-default-function
=C2=A0org-confirm-shel= l-link-function 'yes-or-no-p
=C2=A0org-html-format-drawer-function &= #39;(closure
=C2=A0 (htmlize-buffer-places org-html-format-table-no= -css htmlize-css-name-prefix htmlize-output-type htmlize-output-type
= =C2=A0 =C2=A0htmlize-css-name-prefix t)
=C2=A0 (_name contents) c= ontents)
=C2=A0outline-isearch-open-invisible-function 'outline-isea= rch-open-invisible
=C2=A0org-fold-catch-invisible-edits nil
=C2=A0org= -odt-format-headline-function 'org-odt-format-headline-default-function=
=C2=A0org-agenda-before-write-hook '(org-agenda-add-entry-text)
= =C2=A0org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-m= ode-configure-edit-buffer)
=C2=A0org-confirm-elisp-link-function 'ye= s-or-no-p
=C2=A0org-preview-latex-process-alist '((dvipng :programs = ("latex" "dvipng") :description "dvi > png"= ; :message
=C2=A0 =C2=A0"you need to install the programs: lat= ex and dvipng." :image-input-type "dvi" :image-output-type &= quot;png"
=C2=A0 =C2=A0:image-size-adjust (1.0 . 1.0) :latex-c= ompiler ("latex -interaction nonstopmode -output-directory %o %f"= )
=C2=A0 =C2=A0:image-converter ("dvipng -D %D -T tight -bg Tr= ansparent -o %O %f"))
=C2=A0 (dvisvgm :programs ("latex&q= uot; "dvisvgm") :description "dvi > svg" :message =C2=A0 =C2=A0"you need to install the programs: latex and dvisvg= m." :image-input-type "dvi" :image-output-type "svg&quo= t;
=C2=A0 =C2=A0:image-size-adjust (1.7 . 1.5) :latex-compiler (&qu= ot;latex -interaction nonstopmode -output-directory %o %f")
= =C2=A0 =C2=A0:image-converter ("dvisvgm %f -n -b min -c %S -o %O"= ))
=C2=A0 (imagemagick :programs ("latex" "convert&q= uot;) :description "pdf > png" :message
=C2=A0 =C2=A0&= quot;you need to install the programs: latex and imagemagick." :image-= input-type "pdf" :image-output-type "png"
=C2= =A0 =C2=A0:image-size-adjust (1.0 . 1.0) :latex-compiler ("pdflatex -i= nteraction nonstopmode -output-directory %o %f")
=C2=A0 =C2=A0= :image-converter ("convert -density %D -trim -antialias %f -quality 10= 0 %O"))
=C2=A0 )
=C2=A0org-speed-command-hook '(org-spe= ed-command-activate org-babel-speed-command-activate)
=C2=A0org-html-for= mat-inlinetask-function 'org-html-format-inlinetask-default-function=C2=A0org-ascii-format-inlinetask-function 'org-ascii-format-inlinetas= k-default
=C2=A0org-odt-format-drawer-function '(closure
=C2= =A0(hfy-user-sheet-assoc hfy-html-quote-regex hfy-html-quote-map hfy-face-t= o-css hfy-begin-span-handler
=C2=A0 hfy-end-span-handler nxml-auto-= insert-xml-declaration-flag t)
=C2=A0(_name contents) contents)
= =C2=A0org-persist-directory "c:/Users/Osher/AppData/Local/Temp/org-per= sist-bvcjPn"
=C2=A0org-babel-exp-code-template "#+BEGIN_SRC %l= ang%switches%flags\n%body\n#+END_SRC"
=C2=A0org-fold-core-isearch-o= pen-function 'org-fold--isearch-reveal
=C2=A0org-latex-format-inline= task-function 'org-latex-format-inlinetask-default-function
=C2=A0or= g-persist-before-write-hook '(org-element--cache-persist-before-write)<= br>=C2=A0org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-ba= bel-header-arg-expand)
=C2=A0org-link-shell-confirm-function 'yes-or= -no-p
=C2=A0org-babel-pre-tangle-hook '(save-buffer)
=C2=A0org-ag= enda-loop-over-headlines-in-active-region nil
=C2=A0org-occur-hook '= (org-first-headline-recenter)
=C2=A0org-metadown-hook '(org-babel-po= p-to-session-maybe)
=C2=A0org-link-parameters '(("attachment&qu= ot; :follow org-attach-follow :complete org-attach-complete-link) ("id= " :follow org-id-open)
=C2=A0 =C2=A0 =C2=A0 ("eww" :fo= llow org-eww-open :store org-eww-store-link) ("rmail" :follow org= -rmail-open :store org-rmail-store-link)
=C2=A0 =C2=A0 =C2=A0 ("= mhe" :follow org-mhe-open :store org-mhe-store-link)
=C2=A0 =C2= =A0 =C2=A0 ("irc" :follow org-irc-visit :store org-irc-store-link= :export org-irc-export)
=C2=A0 =C2=A0 =C2=A0 ("info" :foll= ow org-info-open :export org-info-export :store org-info-store-link :insert= -description
org-info-description-as-command)
=C2=A0 =C2=A0 =C2= =A0 ("gnus" :follow org-gnus-open :store org-gnus-store-link)
= =C2=A0 =C2=A0 =C2=A0 ("docview" :follow org-docview-open :expo= rt org-docview-export :store org-docview-store-link)
=C2=A0 =C2=A0 = =C2=A0 ("bibtex" :follow org-bibtex-open :store org-bibtex-store-= link)
=C2=A0 =C2=A0 =C2=A0 ("bbdb" :follow org-bbdb-open :e= xport org-bbdb-export :complete org-bbdb-complete-link :store org-bbdb-stor= e-link)
=C2=A0 =C2=A0 =C2=A0 ("w3m" :store org-w3m-store-li= nk) ("doi" :follow org-link-doi-open :export org-link-doi-export)= ("file+sys") ("file+emacs")
=C2=A0 =C2=A0 =C2=A0= ("shell" :follow org-link--open-shell)
=C2=A0 =C2=A0 =C2= =A0 ("news" :follow #[514 "\301\300\302 Q \"\207" = ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"]= )
=C2=A0 =C2=A0 =C2=A0 ("mailto" :follow #[514 "\301\3= 00\302 Q \"\207" ["mailto" browse-url ":"] 6 = "\n\n(fn URL ARG)"])
=C2=A0 =C2=A0 =C2=A0 ("https"= ; :follow #[514 "\301\300\302 Q \"\207" ["https" b= rowse-url ":"] 6 "\n\n(fn URL ARG)"])
=C2=A0 =C2= =A0 =C2=A0 ("http" :follow #[514 "\301\300\302 Q \"\207= " ["http" browse-url ":"] 6 "\n\n(fn URL ARG)= "])
=C2=A0 =C2=A0 =C2=A0 ("ftp" :follow #[514 "\3= 01\300\302 Q \"\207" ["ftp" browse-url ":"] 6= "\n\n(fn URL ARG)"])
=C2=A0 =C2=A0 =C2=A0 ("help"= ; :follow org-link--open-help :store org-link--store-help) ("file"= ; :complete org-link-complete-file)
=C2=A0 =C2=A0 =C2=A0 ("elisp= " :follow org-link--open-elisp))
=C2=A0org-html-format-headline-fun= ction 'org-html-format-headline-default-function
=C2=A0org-metaup-ho= ok '(org-babel-load-in-session-maybe)
=C2=A0org-src-lang-modes '= (("C" . c) ("C++" . c++) ("asymptote" . asy) = ("bash" . sh) ("beamer" . latex) ("calc" . fu= ndamental) ("cpp" . c++)
=C2=A0 =C2=A0 =C2=A0("ditaa&q= uot; . artist) ("dot" . fundamental) ("elisp" . emacs-l= isp) ("ocaml" . tuareg) ("screen" . shell-script) (&quo= t;shell" . sh)
=C2=A0 =C2=A0 =C2=A0("sqlite" . sql))=C2=A0)
--000000000000684a3f05f265bef8-- --000000000000684a4205f265befa Content-Type: application/octet-stream; name=ob-shell-eval-with-newline Content-Disposition: attachment; filename=ob-shell-eval-with-newline Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lcz0b3yd0 ZGlmZiAtLWdpdCBhL2xpc3Avb2Itc2hlbGwuZWwgYi9saXNwL29iLXNoZWxsLmVsDQppbmRleCAy YzMwYTI2MDUuLjk1ZWE0ZjYzNSAxMDA2NDQNCi0tLSBhL2xpc3Avb2Itc2hlbGwuZWwNCisrKyBi L2xpc3Avb2Itc2hlbGwuZWwNCkBAIC0zMjQsNyArMzI0LDcgQEAgcmV0dXJuIHRoZSB2YWx1ZSBv ZiB0aGUgbGFzdCBzdGF0ZW1lbnQgaW4gQk9EWS4iDQogCQkoaW5zZXJ0IGJvZHkpKQ0KIAkgICAg ICAoc2V0LWZpbGUtbW9kZXMgc2NyaXB0LWZpbGUgI283NTUpDQogCSAgICAgIChvcmctYmFiZWwt ZXZhbCBzY3JpcHQtZmlsZSAiIikpKQ0KLQkgICAodCAob3JnLWJhYmVsLWV2YWwgc2hlbGwtZmls ZS1uYW1lIChvcmctdHJpbSBib2R5KSkpKSkpDQorCSAgICh0IChvcmctYmFiZWwtZXZhbCBzaGVs bC1maWxlLW5hbWUgKGNvbmNhdCAob3JnLXRyaW0gYm9keSkgIlxuIikpKSkpKQ0KICAgICAod2hl biAoYW5kIHJlc3VsdHMgdmFsdWUtaXMtZXhpdC1zdGF0dXMpDQogICAgICAgKHNldHEgcmVzdWx0 cyAoY2FyIChyZXZlcnNlIChzcGxpdC1zdHJpbmcgcmVzdWx0cyAiXG4iIHQpKSkpKQ0KICAgICAo d2hlbiByZXN1bHRzDQo= --000000000000684a4205f265befa--