Skip to content

Commit d944300

Browse files
committed
use different control codes as MPI start/end delimiters
Literal ESC is tricky because it can be consumed by the shell or otherwise misinterpreted. Use FS to mark the beginning, GS to mark the end, and RS (which was previously used) to mark the end of the header. Hopefully the separator control codes are unlikely to cause conflicts. Also simplify the delimiters to use *solely* the control code and not rely on other adjacent ASCII characters. Make corresponding updates to elisp variables ess-mpi-message-{start,end}-delimiter and update the docstring for `ess-mpi-handle-messages` (which curiously already used GS as the end separator).
1 parent 2ce1846 commit d944300

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

etc/ESSR/R/mpi.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
else as.character(el)
88
})
99
payload <- paste(dots, collapse = "")
10-
cat(sprintf("\033_%s036%s\033\\", head, payload))
10+
cat(sprintf("\034%s\036%s\035", head, payload))
1111
}
1212

1313
.ess_mpi_message <- function(msg){

lisp/ess-tracebug.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,9 +1183,9 @@ Kill the *ess.dbg.[R_name]* buffer."
11831183

11841184
;; http://jkorpela.fi/chars/c0.html
11851185
;; https://en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences
1186-
(defvar ess-mpi-message-start-delimiter "_")
1186+
(defvar ess-mpi-message-start-delimiter "")
11871187
(defvar ess-mpi-message-field-separator "")
1188-
(defvar ess-mpi-message-end-delimiter "\\")
1188+
(defvar ess-mpi-message-end-delimiter "")
11891189

11901190
(define-obsolete-variable-alias 'ess-mpi-alist 'ess-mpi-handlers "ESS 19.04")
11911191
(defvar ess-mpi-handlers
@@ -1229,7 +1229,7 @@ value from EXPR and then sent to the subprocess."
12291229

12301230
(defun ess-mpi-handle-messages (buf)
12311231
"Handle all mpi messages in BUF and delete them.
1232-
The MPI message has the form TYPEFIELD... where TYPE is the
1232+
The MPI message has the form TYPEFIELD... where TYPE is the
12331233
type of the messages on which handlers in `ess-mpi-handlers' are
12341234
dispatched. And FIELDs are strings. Return :incomplete if BUF
12351235
ends with an incomplete message."

0 commit comments

Comments
 (0)