Use this file in Rendered or Split view to exercise fenced-block Run.
Open from the repo: test_md/test_code_execution.md.
- Settings → Editor → Code execution
- Enable Allow code execution (or click Run once and accept the consent dialog).
- Enable Allow shell blocks and Allow Python blocks.
- Enable Show inline output (turn off briefly for toast-only tests in §12).
- Timeout: 30 s default; use 5 s for §10 (timeout) only.
- Save this file to disk so working-directory tests (§8) use
test_md/as cwd. - Record: OS, shell availability (Git Bash / WSL / none), Python version.
| Symbol | Meaning |
|---|---|
| ✓ | Expected behaviour |
| ⚠ | Platform-dependent — note what you saw |
| ✗ | Bug — describe actual vs expected |
These blocks control which fences show Run. No need to click Run unless noted.
// NO Run — unsupported language
fn main() { println!("rust"); }// NO Run — unsupported language
console.log("js");// NO Run — unsupported language
Console.WriteLine("csharp");plain text fence — NO Run
Expected: No Run on the four blocks above.
Write-Output "Hello from PowerShell"Expected: ✓ Exit 0 · Hello from PowerShell · elapsed < 1 s
echo Hello from CMDExpected: ✓ Exit 0 · Hello from CMD
print("Hello from Python")Expected: ✓ Exit 0 · Hello from Python (CRLF on Windows is OK)
echo "Hello from Bash"Expected: ✓ on Unix or Windows with bash in PATH · ⚠ on plain Windows without bash — may fail or run via wrong interpreter (see review notes)
1..5 | ForEach-Object { Write-Output "Line $_" }
Write-Output "Done."Expected: ✓ Five numbered lines + Done. · panel scrolls if height > ~220 px · Copy / Insert as block include all lines
Write-Output "This is stdout"
Write-Error "This is stderr" -ErrorAction Continue
Write-Output "Back to stdout"Expected: ✓ Exit non-zero (PowerShell treats Write-Error as error) · stdout and stderr both visible · stderr under ── stderr ── heading · failure icon (✗)
import sys
print("stdout line")
print("stderr line", file=sys.stderr)
print("stdout again")Expected: ✓ Exit 0 · both streams visible · stderr section present
exit /b 0Expected: ✓ Green success · Exit 0 · may show “no output” hint
exit /b 42Expected: ✓ Red failure · Exit 42 · no output or minimal output
# Intentionally empty — no print()
x = 1 + 1Expected: ✓ Exit 0 · panel shows “no output” message and hint (not a blank scroll area)
$null = 1Expected: ✓ Same as above — success with no captured bytes
print("\033[31mRed text\033[0m normal")
print("\033[1;32mBold green\033[0m")
print("\033[38;5;208mOrange (256-color)\033[0m")Expected: ✓ Colored text in inline panel · Copy strips ANSI escapes · theme matches terminal palette (dark/light)
Get-Location | Select-Object -ExpandProperty Path
Split-Path -Leaf (Get-Location)Expected: ✓ Path ends with test_md (or parent folder where this file lives) · not Ferrite install dir
import os
print(os.getcwd())
print(os.path.basename(os.getcwd()))Expected: ✓ Same cwd as §8 PowerShell block
for i in range(1, 81):
print(f"Row {i:03d}: " + "x" * 60)
print("END")Expected: ✓ 81 lines · vertical scroll inside output panel (max ~220 px) · horizontal scroll for long lines · END visible after scroll · UI stays responsive
import time
print("Starting sleep…")
time.sleep(60)
print("Should not appear")Expected: ✓ Within ~5 s: Timed out after 5s · Starting sleep… may appear · final line never shown · Stop also works if clicked early (§11)
Restore timeout to 30 s after this test.
import time
print("Running…")
for i in range(300):
time.sleep(1)
print(f"tick {i}")Expected: Click Stop within a few seconds · Stopped by user · partial stdout (e.g. Running…, maybe ticks) · Run enabled again after finish · no hung spinner
- Settings → disable Show inline output.
- Run:
Write-Output "Toast test message"Expected: ✓ No inline panel · toast on completion with output snippet · re-enable inline output before continuing
To re-test first-run consent: set code_execution_consent_acknowledged to false in config or use a fresh profile, disable master toggle, then click Run on:
Write-Output "Consent flow test"Expected: ✓ Modal appears · Enable and run executes and shows output · Just enable enables without running · Cancel aborts
Use §2a or §3, wait for completion, then:
- Copy — paste into Notepad; plain text, no ANSI.
- Insert as block — appends fenced
```outputblock after the source fence. - Dismiss — panel clears; Run works again.
Expected: ✓ Inserted block appears immediately below the code fence in source · rendered view updates
import sys, time
for i in range(1, 11):
sys.stdout.write(f"\rProgress: {i}/10")
sys.stdout.flush()
time.sleep(0.15)
print() # final newline
print("Complete")Expected: ✓ Final progress line shows Progress: 10/10 (not ten separate lines) · Complete on its own line · CRLF from Python on Windows must not wipe lines (regression for \r\n normalization)
Run each block top-to-bottom; each should keep its own output panel state.
Write-Output "Block A"print("Block B")echo Block CExpected: ✓ Three independent Run buttons · running A does not disable B/C · output attaches to the correct block only
& 'C:\Definitely\Not\A\Real\Executable.exe'Expected: ✓ Failed status · error message in panel (spawn or execution error) · no crash
print("missing paren"Expected: ✓ Non-zero exit · traceback on stderr · stderr section visible
| Section | Pass? | Notes |
|---|---|---|
| §1 visibility | ||
| §2 simple | ||
| §3 multiline | ||
| §4 stderr | ||
| §5 exit codes | ||
| §6 no output | ||
| §7 ANSI | ||
| §8 cwd | ||
| §9 long output | ||
| §10 timeout | ||
| §11 stop | ||
| §12 toast | ||
| §13 consent | ||
| §14 insert/copy | ||
§15 \r progress |
||
| §16 sequence | ||
| §17 spawn error | ||
| §18 py syntax |
docs/technical/markdown/code-block-run.mddocs/technical/config/code-execution-settings.mdtest_md/test_consecutive_code_blocks.md— layout regression for multiple fences (issue #129)