From a24bfabea842c4485abd86b608d8293e4a436a67 Mon Sep 17 00:00:00 2001 From: "J.J. Allaire" Date: Tue, 3 Oct 2023 16:51:05 -0400 Subject: [PATCH] set shell interactivity for documents with server to 'all' --- src/command/render/render-contexts.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/command/render/render-contexts.ts b/src/command/render/render-contexts.ts index 123cfef7c3..19ee8e5f57 100644 --- a/src/command/render/render-contexts.ts +++ b/src/command/render/render-contexts.ts @@ -44,6 +44,7 @@ import { kIncludeBeforeBody, kIncludeInHeader, kIpynbFilters, + kIpynbShellInteractivity, kMetadataFormat, kOutputExt, kOutputFile, @@ -529,12 +530,15 @@ async function resolveFormats( inputFormat || {}, ); - // if there is no "echo" set by the user then default - // to false for documents with a server - if (userFormat.execute[kEcho] === undefined) { - if (userFormat.metadata[kServer] !== undefined) { + // default 'echo' and 'ipynb-shell-interactivity' + // for documents with a server + if (userFormat.metadata[kServer] !== undefined) { + if (userFormat.execute[kEcho] === undefined) { userFormat.execute[kEcho] = false; } + if (userFormat.execute[kIpynbShellInteractivity] === undefined) { + userFormat.execute[kIpynbShellInteractivity] = "all"; + } } // If options request, force echo