From 5fd50986d5c9a869a1fe54ffecaa6fbdf664dc77 Mon Sep 17 00:00:00 2001 From: Anthony Kim <62267334+anthonykim1@users.noreply.github.com> Date: Thu, 11 Jul 2024 09:55:23 -0700 Subject: [PATCH] Minimize execution output when there is no output for new REPL (#23786) Resolves: https://github.com/microsoft/vscode-python/issues/23520 --- src/client/repl/replController.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/repl/replController.ts b/src/client/repl/replController.ts index 86d021cd1c7a..7f11b654c54e 100644 --- a/src/client/repl/replController.ts +++ b/src/client/repl/replController.ts @@ -24,10 +24,11 @@ export function createReplController( exec.start(Date.now()); try { const result = await server.execute(cell.document.getText()); - - exec.replaceOutput([ - new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.text(result, 'text/plain')]), - ]); + if (result !== '') { + exec.replaceOutput([ + new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.text(result, 'text/plain')]), + ]); + } exec.end(true); } catch (err) { const error = err as Error;