From 45c3817f05c3c72e27431f48fcd0d10411884ffe Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Thu, 1 Feb 2024 19:27:56 +0100 Subject: [PATCH] Prevent failed block from appearing before `show` command output --- main/src/terminal/Terminal.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/src/terminal/Terminal.ts b/main/src/terminal/Terminal.ts index fcbfff69..40d8e6de 100644 --- a/main/src/terminal/Terminal.ts +++ b/main/src/terminal/Terminal.ts @@ -1380,7 +1380,8 @@ export class Terminal implements Tab, Disposable { const scrollbackOutputLength = terminalBlock.getScrollbackLength() - this.#frameStartBookmark.row; const effectiveScreenLength = this.#emulator.getCursorRow(); - const commandShouldBeFramed = returnCode !== "0" || this.#commandNeedsFrame(this.#lastCommandLine, + const isSuccess = returnCode === "0" || returnCode === ""; + const commandShouldBeFramed = !isSuccess || this.#commandNeedsFrame(this.#lastCommandLine, scrollbackOutputLength + effectiveScreenLength); if (commandShouldBeFramed) { this.#disconnectLastTerminalFrameFromEmulator();