pi-studio 0.10.5 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +4 -3
- package/client/studio-client.js +87 -24
- package/client/studio.css +20 -4
- package/index.ts +504 -42
- package/package.json +1 -1
- package/shared/REPL_SESSION_RECORD_PROTOCOL.md +19 -7
- package/shared/repl-control-files.js +19 -7
- package/shared/repl-cpp-driver.hxx +164 -0
- package/shared/repl-cpp.js +107 -0
- package/shared/repl-cursor-column.js +46 -0
- package/shared/repl-gnuplot-processes.js +2 -1
- package/shared/repl-gnuplot.js +59 -0
- package/shared/repl-m-language.js +56 -0
- package/shared/repl-session-stop.js +5 -3
- package/shared/repl-submission-display.js +59 -37
- package/shared/studio-repl-tmux.js +41 -10
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,32 @@ All notable changes to `pi-studio` are documented here.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.11.1] — 2026-10-22
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- While a prompt runs, the status beside **Stop** shows the elapsed time alone ("0:16"), and "Compacting context…" is now "Compacting…". The status keeps only the room "Starting…" and "Stopping…" need, so the toolbar's tools stay on the first row in narrower windows: with the default split, from about 1,315 px wide, down from about 1,390.
|
|
11
|
+
- The line above a response shows which one you're on at its right end ("9/9"), in the accent colour while an older response is showing. The rest of the line reads "Assistant response · 10:08:28 PM".
|
|
12
|
+
- The REPL pane uses pi-repl 0.10.5's shared helpers to end each send's output and to run Octave and MATLAB, in place of its own copies. Code runs as before.
|
|
13
|
+
|
|
14
|
+
## [0.11.0] — 2026-10-21
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- The REPL pane runs **Ruby** (irb) and **Java** (JShell), as pi-repl does. Choose them under **Runtime**, or send to a pi-repl Ruby or Java session. In Java, print values with `System.out.println(…)`: code is loaded with `/open`, which doesn't show expression results. Stop waits for JShell's second JVM to exit too.
|
|
18
|
+
- The REPL pane runs **Octave** (`octave-cli`) and **MATLAB**, as pi-repl does, as separate runtimes. Code runs in the base workspace, with the usual `ans` and semicolon behaviour; errors and Ctrl+C still complete the send. MATLAB starts without its desktop in the working directory, and Studio waits up to two minutes for its prompt. Stopping Octave doesn't leave an `octave-workspace` file in the working directory, unless you start it with your own **Start cmd**.
|
|
19
|
+
- The REPL pane runs **gnuplot**, as pi-repl does. Code runs as written, so your terminal and settings stay as you set them, and errors and Ctrl+C still complete the send. Stop also closes its Qt plot windows.
|
|
20
|
+
- The REPL pane runs **C++** in Cling, as pi-repl does. Send complete prompt groups, with a function's opening brace on its declaration line. Errors, incomplete code and uncaught C++ exceptions still complete the send, and earlier groups keep their effect. Cling and its development headers need to be on your PATH.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- Pane echo defaults to **Summary**, as in pi-repl, so the tmux pane shows each sent submission above its output. Summary now shows up to 20 lines or 2,000 characters, up from 6 lines or 600. If you chose Full before, Studio keeps it; if you chose Off, choose it again.
|
|
24
|
+
- In dual mode, **Pane echo** is under the REPL pane's **More**, below **Send mode**. The toolbar had stopped showing it, so it couldn't be changed there. Choose **Off** for a quiet pane.
|
|
25
|
+
- With Pane echo **Off**, a send whose output doesn't end its line now ends it, as pi-repl does. The record keeps that output, and the runtime's next prompt starts on a line of its own.
|
|
26
|
+
- Pane echo looks the same as pi-repl's: `── pi-studio · input · 2 lines · id: … ──`, then the code without `│` bars, the output, `── done · id: … ──` and a blank line. A blank line also separates the code from the line that loads it. Studio's temporary files for a send start with the same id. The record still holds only the code and its output.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
- When a runtime exits or crashes during a send, the send ends within a couple of seconds with "… ended while running the code." It used to wait out its 20-second timeout and then report that Studio couldn't capture the session. If tmux keeps the dead pane, the record keeps what it shows.
|
|
30
|
+
- In a Julia pane narrower than the line that loads the code, sent code no longer leaves copies of that line in the output. Studio pastes it as one bracketed paste, as pi-repl 0.8.5 does.
|
|
31
|
+
- With Summary or Full, the done marker goes on a line of its own when the output doesn't end with a newline, as with `print("c", end="")`. It used to join the output's last line and end up in the record.
|
|
32
|
+
|
|
7
33
|
## [0.10.5] — 2026-10-20
|
|
8
34
|
|
|
9
35
|
### Fixed
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Watch the [demo](https://github.com/omaclaren/pi-studio/releases/download/demo-p
|
|
|
27
27
|
- **Files and Changes** — browse folders you've allowed, open or preview files, and see the current git diff.
|
|
28
28
|
- **Comments and scratchpad** — comments anchored to lines or selections, and a scratchpad per document.
|
|
29
29
|
- **Side questions and quizzes** — ask about the text, a folder or the repository in a separate thread that stays out of the main conversation, or quiz yourself on it.
|
|
30
|
-
- **REPL** — send code to tmux-backed Shell, Python, IPython, Julia, R, GHCi or
|
|
30
|
+
- **REPL** — send code to tmux-backed Shell, Python, IPython, Julia, R, GHCi, Clojure, Ruby, Java, Octave, MATLAB, gnuplot or C++ (Cling) sessions, shared with [pi-repl](https://github.com/omaclaren/pi-repl).
|
|
31
31
|
- **Export** — PDF (Pandoc and LaTeX) or standalone HTML, from the preview, a file or the last response.
|
|
32
32
|
|
|
33
33
|
## Requirements
|
|
@@ -36,6 +36,7 @@ Watch the [demo](https://github.com/omaclaren/pi-studio/releases/download/demo-p
|
|
|
36
36
|
- [Pandoc](https://pandoc.org/installing.html) for full previews and exports (`brew install pandoc` on macOS), and LaTeX (TeX Live or MacTeX) for PDF export
|
|
37
37
|
- Optional:
|
|
38
38
|
- `tmux` for the REPL;
|
|
39
|
+
- a JDK with `jshell` for the Java REPL, and `matlab` for MATLAB, on the PATH Pi runs with, since Studio doesn't start them through a login shell (or give the full path in the REPL pane's **Start cmd**);
|
|
39
40
|
- `quarto` for Quarto previews;
|
|
40
41
|
- Mermaid CLI 11.12+ for diagrams in exported PDFs;
|
|
41
42
|
- `pdftotext` so side questions can read PDFs;
|
|
@@ -135,7 +136,7 @@ Icons in exported PDFs need Mermaid CLI 11.12+ (`npm install -g @mermaid-js/merm
|
|
|
135
136
|
|
|
136
137
|
### REPL
|
|
137
138
|
|
|
138
|
-
The REPL pane runs code in tmux sessions. It can start its own, and it shares a record of submissions and output with [pi-repl](https://github.com/omaclaren/pi-repl) when both use the same session. Pane echo
|
|
139
|
+
The REPL pane runs code in tmux sessions. It can start its own, and it shares a record of submissions and output with [pi-repl](https://github.com/omaclaren/pi-repl) when both use the same session. Pane echo sets how much submitted code goes into the raw tmux history, as in pi-repl: up to 20 lines with Summary, the default, up to 40 with Full, and none with Off. The record format is in [`shared/REPL_SESSION_RECORD_PROTOCOL.md`](./shared/REPL_SESSION_RECORD_PROTOCOL.md).
|
|
139
140
|
|
|
140
141
|
### Side questions
|
|
141
142
|
|
|
@@ -155,7 +156,7 @@ For a container, `/studio --no-browser --listen-all --port 4321` listens on all
|
|
|
155
156
|
| `MERMAID_CLI_PATH` | Mermaid CLI for diagrams in PDFs |
|
|
156
157
|
| `BRAVE_API_KEY` | Enables web search in side questions |
|
|
157
158
|
| `PI_STUDIO_FONT_MONO`, `PI_STUDIO_FONT_UI`, `PI_STUDIO_FONT_PROSE` | CSS font stacks for code, interface and previews |
|
|
158
|
-
| `PI_STUDIO_REPL_ECHO_MODE` | Default pane echo for `studio_repl_send`: `
|
|
159
|
+
| `PI_STUDIO_REPL_ECHO_MODE` | Default pane echo for `studio_repl_send`: `summary` (the default), `off` or `full` |
|
|
159
160
|
| `PI_STUDIO_PANDOC_TIMEOUT_MS`, `PI_STUDIO_LATEX_TIMEOUT_MS`, `PI_STUDIO_MERMAID_TIMEOUT_MS` | Export time limits |
|
|
160
161
|
|
|
161
162
|
Installing pi-studio also adds `pi-studio-dark` and `pi-studio-light` to Pi's themes, without changing your current theme.
|
package/client/studio-client.js
CHANGED
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
? responseActionsEl.closest(".response-wrap")
|
|
108
108
|
: null;
|
|
109
109
|
const referenceBadgeEl = document.getElementById("referenceBadge");
|
|
110
|
+
const referenceHistoryCountEl = document.getElementById("referenceHistoryCount");
|
|
110
111
|
const editorViewSelect = document.getElementById("editorViewSelect");
|
|
111
112
|
const editorViewSelectWrap = document.getElementById("editorViewSelectWrap");
|
|
112
113
|
const rightViewSelect = document.getElementById("rightViewSelect");
|
|
@@ -738,10 +739,13 @@
|
|
|
738
739
|
})();
|
|
739
740
|
let replEchoMode = (() => {
|
|
740
741
|
try {
|
|
741
|
-
const stored = String((window.localStorage && window.localStorage.getItem("piStudio.replEchoMode.
|
|
742
|
-
|
|
742
|
+
const stored = String((window.localStorage && window.localStorage.getItem("piStudio.replEchoMode.v3")) || "").trim().toLowerCase();
|
|
743
|
+
if (stored === "off" || stored === "summary" || stored === "full") return stored;
|
|
744
|
+
// v2 saved Off whether or not it was chosen; keep only a Full chosen there.
|
|
745
|
+
const earlier = String((window.localStorage && window.localStorage.getItem("piStudio.replEchoMode.v2")) || "").trim().toLowerCase();
|
|
746
|
+
return earlier === "full" ? "full" : "summary";
|
|
743
747
|
} catch {
|
|
744
|
-
return "
|
|
748
|
+
return "summary";
|
|
745
749
|
}
|
|
746
750
|
})();
|
|
747
751
|
function normalizeReplJournalEntry(entry) {
|
|
@@ -947,13 +951,14 @@
|
|
|
947
951
|
const run = studioRuntimeActivity?.run;
|
|
948
952
|
if (wsState === "Disconnected" || wsState === "Connecting") return run ? "Run status unknown · reconnecting…" : "Reconnecting…";
|
|
949
953
|
const stopping = run && (run.stopping || studioStopRequestedRunId === run.id);
|
|
950
|
-
if (stopping) return "Stopping…" + (studioRuntimeActivity.compaction ? " · Compacting
|
|
951
|
-
if (studioRuntimeActivity?.compaction) return "Compacting
|
|
954
|
+
if (stopping) return "Stopping…" + (studioRuntimeActivity.compaction ? " · Compacting…" : "");
|
|
955
|
+
if (studioRuntimeActivity?.compaction) return "Compacting…";
|
|
952
956
|
if (run) {
|
|
953
957
|
if (run.origin === "outside") return "Pi is busy · started outside Studio";
|
|
954
958
|
if (run.origin === "unknown") return "Pi is busy · run origin unknown";
|
|
955
959
|
const seconds = Math.max(0, Math.floor((Date.now() - run.startedAt) / 1000));
|
|
956
|
-
|
|
960
|
+
// Oliver, 22 Oct: the clock alone, beside Stop, so the running row fits narrower windows.
|
|
961
|
+
return Math.floor(seconds / 60) + ":" + String(seconds % 60).padStart(2, "0");
|
|
957
962
|
}
|
|
958
963
|
// Oliver, 14 Oct: a Run waiting for Pi to start says so briefly here, so Queue steering fits
|
|
959
964
|
// beside it and the toolbar doesn't wrap and jump back. The footer keeps the detail.
|
|
@@ -1498,6 +1503,7 @@
|
|
|
1498
1503
|
function getKnownReplRuntime(value) {
|
|
1499
1504
|
const runtime = String(value || "").trim().toLowerCase();
|
|
1500
1505
|
return runtime === "shell" || runtime === "python" || runtime === "ipython" || runtime === "julia" || runtime === "r" || runtime === "ghci" || runtime === "clojure"
|
|
1506
|
+
|| runtime === "ruby" || runtime === "java" || runtime === "octave" || runtime === "matlab" || runtime === "gnuplot" || runtime === "cpp"
|
|
1501
1507
|
? runtime
|
|
1502
1508
|
: "";
|
|
1503
1509
|
}
|
|
@@ -1514,6 +1520,12 @@
|
|
|
1514
1520
|
if (runtime === "julia") return "Julia";
|
|
1515
1521
|
if (runtime === "r") return "R";
|
|
1516
1522
|
if (runtime === "ghci") return "GHCi";
|
|
1523
|
+
if (runtime === "ruby") return "Ruby";
|
|
1524
|
+
if (runtime === "java") return "Java";
|
|
1525
|
+
if (runtime === "octave") return "Octave";
|
|
1526
|
+
if (runtime === "matlab") return "MATLAB";
|
|
1527
|
+
if (runtime === "gnuplot") return "gnuplot";
|
|
1528
|
+
if (runtime === "cpp") return "C++";
|
|
1517
1529
|
return "Clojure";
|
|
1518
1530
|
}
|
|
1519
1531
|
|
|
@@ -1590,7 +1602,7 @@
|
|
|
1590
1602
|
|
|
1591
1603
|
function normalizeReplEchoMode(value) {
|
|
1592
1604
|
const normalized = String(value || "").trim().toLowerCase();
|
|
1593
|
-
return normalized === "
|
|
1605
|
+
return normalized === "off" || normalized === "full" ? normalized : "summary";
|
|
1594
1606
|
}
|
|
1595
1607
|
|
|
1596
1608
|
function isMacShortcutPlatform() {
|
|
@@ -1651,12 +1663,23 @@
|
|
|
1651
1663
|
replEchoMode = normalizeReplEchoMode(mode);
|
|
1652
1664
|
if (replEchoModeSelect) replEchoModeSelect.value = replEchoMode;
|
|
1653
1665
|
try {
|
|
1654
|
-
if (window.localStorage) window.localStorage.setItem("piStudio.replEchoMode.
|
|
1666
|
+
if (window.localStorage) window.localStorage.setItem("piStudio.replEchoMode.v3", replEchoMode);
|
|
1655
1667
|
} catch {
|
|
1656
1668
|
// Ignore storage failures.
|
|
1657
1669
|
}
|
|
1658
1670
|
}
|
|
1659
1671
|
|
|
1672
|
+
function chooseReplEchoMode(mode) {
|
|
1673
|
+
setReplEchoMode(mode);
|
|
1674
|
+
syncActionButtons();
|
|
1675
|
+
setStatus(replEchoMode === "full"
|
|
1676
|
+
? "Full pane echo enabled. Bounded submitted source code will remain in raw terminal history."
|
|
1677
|
+
: (replEchoMode === "off"
|
|
1678
|
+
? "Pane echo disabled; new sends will not add alignment anchors to raw terminal history."
|
|
1679
|
+
: "Summary pane echo enabled; short submissions will be shown with compact anchors and a plain output divider."),
|
|
1680
|
+
replEchoMode === "full" ? "warning" : "success");
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1660
1683
|
function syncReplEchoModeSelect(visible) {
|
|
1661
1684
|
if (!replEchoModeSelect) return;
|
|
1662
1685
|
replEchoModeSelect.hidden = !visible;
|
|
@@ -1666,7 +1689,7 @@
|
|
|
1666
1689
|
? "Do not add a submitted-code display or alignment anchors to the raw REPL pane."
|
|
1667
1690
|
: (replEchoMode === "full"
|
|
1668
1691
|
? "Display up to 40 lines or 4,000 characters of submitted code; source remains in raw terminal history."
|
|
1669
|
-
: "Display short submissions in full, truncating after
|
|
1692
|
+
: "Display short submissions in full, truncating after 20 lines or 2,000 characters, with compact anchors and a plain output divider.");
|
|
1670
1693
|
}
|
|
1671
1694
|
|
|
1672
1695
|
function getReplQuickDraftKey(session) {
|
|
@@ -2256,6 +2279,8 @@
|
|
|
2256
2279
|
if (first === "bash") return "shell";
|
|
2257
2280
|
if (first === "hs" || first === "haskell") return "ghci";
|
|
2258
2281
|
if (first === "clj" || first === "cljc") return "clojure";
|
|
2282
|
+
if (first === "rb") return "ruby";
|
|
2283
|
+
if (first === "c++" || first === "cxx" || first === "hpp") return "cpp";
|
|
2259
2284
|
return first;
|
|
2260
2285
|
}
|
|
2261
2286
|
|
|
@@ -2313,6 +2338,12 @@
|
|
|
2313
2338
|
if (activeRuntime === "shell") return lang === "shell" || lang === "bash" || lang === "sh";
|
|
2314
2339
|
if (activeRuntime === "ghci") return lang === "ghci" || lang === "haskell";
|
|
2315
2340
|
if (activeRuntime === "clojure") return lang === "clojure";
|
|
2341
|
+
if (activeRuntime === "ruby") return lang === "ruby";
|
|
2342
|
+
if (activeRuntime === "java") return lang === "java";
|
|
2343
|
+
if (activeRuntime === "octave") return lang === "octave";
|
|
2344
|
+
if (activeRuntime === "matlab") return lang === "matlab";
|
|
2345
|
+
if (activeRuntime === "gnuplot") return lang === "gnuplot";
|
|
2346
|
+
if (activeRuntime === "cpp") return lang === "cpp";
|
|
2316
2347
|
return true;
|
|
2317
2348
|
}
|
|
2318
2349
|
|
|
@@ -7355,6 +7386,7 @@
|
|
|
7355
7386
|
|
|
7356
7387
|
function updateReferenceBadge() {
|
|
7357
7388
|
if (!referenceBadgeEl) return;
|
|
7389
|
+
if (referenceHistoryCountEl) referenceHistoryCountEl.hidden = true;
|
|
7358
7390
|
const referenceMetaEl = referenceBadgeEl.closest(".reference-meta");
|
|
7359
7391
|
if (rightView === "repl" || (studioUiRefreshUi && rightView === "editor-preview") || (bufferSwitchingEnabled && studioUiRefreshUi && rightView === "files")) {
|
|
7360
7392
|
if (referenceMetaEl instanceof HTMLElement) referenceMetaEl.hidden = true;
|
|
@@ -7461,10 +7493,20 @@
|
|
|
7461
7493
|
const selected = total > 0 && responseHistoryIndex >= 0 && responseHistoryIndex < total
|
|
7462
7494
|
? responseHistoryIndex + 1
|
|
7463
7495
|
: 0;
|
|
7464
|
-
|
|
7496
|
+
// Oliver, 22 Oct: the new layout shows the count on its own at the right, as agent-markdown-preview
|
|
7497
|
+
// does, so it's quick to find, and in the accent colour while an older response is showing.
|
|
7498
|
+
const countAtRight = Boolean(studioUiRefreshUi && referenceHistoryCountEl && total > 0);
|
|
7499
|
+
if (countAtRight) {
|
|
7500
|
+
referenceHistoryCountEl.textContent = selected + "/" + total;
|
|
7501
|
+
referenceHistoryCountEl.title = "Response " + selected + " of " + total + " in this branch's history";
|
|
7502
|
+
referenceHistoryCountEl.classList.toggle("is-older", selected > 0 && selected < total);
|
|
7503
|
+
referenceHistoryCountEl.hidden = false;
|
|
7504
|
+
}
|
|
7505
|
+
const historyPrefix = total > 0 && !countAtRight ? "Branch history " + selected + "/" + total + " · " : "";
|
|
7506
|
+
const label = countAtRight ? responseLabel.charAt(0).toUpperCase() + responseLabel.slice(1) : responseLabel;
|
|
7465
7507
|
referenceBadgeEl.textContent = time
|
|
7466
|
-
? historyPrefix +
|
|
7467
|
-
: historyPrefix +
|
|
7508
|
+
? historyPrefix + label + " · " + time
|
|
7509
|
+
: historyPrefix + label;
|
|
7468
7510
|
}
|
|
7469
7511
|
|
|
7470
7512
|
function normalizeForCompare(text) {
|
|
@@ -12064,6 +12106,12 @@
|
|
|
12064
12106
|
renderReplViewIfActive({ force: true });
|
|
12065
12107
|
return;
|
|
12066
12108
|
}
|
|
12109
|
+
const echoModeSelect = target.closest("[data-repl-echo-mode]");
|
|
12110
|
+
if (echoModeSelect && "value" in echoModeSelect) {
|
|
12111
|
+
chooseReplEchoMode(echoModeSelect.value);
|
|
12112
|
+
renderReplViewIfActive({ force: true });
|
|
12113
|
+
return;
|
|
12114
|
+
}
|
|
12067
12115
|
const commandInput = target.closest("[data-repl-command]");
|
|
12068
12116
|
if (commandInput && "value" in commandInput) {
|
|
12069
12117
|
// For the runtime it was drawn for, even if another was selected meanwhile.
|
|
@@ -13923,6 +13971,8 @@
|
|
|
13923
13971
|
if (normalized === "shell") return "bash";
|
|
13924
13972
|
if (normalized === "ipython") return "python";
|
|
13925
13973
|
if (normalized === "python" || normalized === "julia" || normalized === "r") return normalized;
|
|
13974
|
+
if (normalized === "octave" || normalized === "matlab") return "matlab";
|
|
13975
|
+
if (normalized === "cpp") return "cpp";
|
|
13926
13976
|
return "text";
|
|
13927
13977
|
}
|
|
13928
13978
|
|
|
@@ -13969,6 +14019,12 @@
|
|
|
13969
14019
|
if (normalized === "shell") return "$";
|
|
13970
14020
|
if (normalized === "ghci") return "ghci>";
|
|
13971
14021
|
if (normalized === "clojure") return "user=>";
|
|
14022
|
+
if (normalized === "ruby") return "irb>";
|
|
14023
|
+
if (normalized === "java") return "jshell>";
|
|
14024
|
+
if (normalized === "octave") return "octave>";
|
|
14025
|
+
if (normalized === "matlab") return ">>";
|
|
14026
|
+
if (normalized === "gnuplot") return "gnuplot>";
|
|
14027
|
+
if (normalized === "cpp") return "[cling]$";
|
|
13972
14028
|
return ">>>";
|
|
13973
14029
|
}
|
|
13974
14030
|
|
|
@@ -13999,6 +14055,12 @@
|
|
|
13999
14055
|
if (normalized === "r") return /^\s*(?:>|\+)\s?/.test(source);
|
|
14000
14056
|
if (normalized === "ghci") return /^\s*(?:ghci>|Prelude>|\*?[A-Za-z0-9_.:]+>)\s?/.test(source);
|
|
14001
14057
|
if (normalized === "clojure") return /^\s*[A-Za-z0-9_.-]+=>\s?/.test(source);
|
|
14058
|
+
if (normalized === "ruby") return /^\s*irb\([^)]*\):\d+(?::\d+)?[>*]\s?/.test(source);
|
|
14059
|
+
if (normalized === "java") return /^\s*jshell>\s?/.test(source);
|
|
14060
|
+
if (normalized === "octave") return /^\s*octave:\d+>\s?/.test(source);
|
|
14061
|
+
if (normalized === "matlab") return /^\s*>>\s?/.test(source);
|
|
14062
|
+
if (normalized === "gnuplot") return /^\s*gnuplot>\s?/.test(source);
|
|
14063
|
+
if (normalized === "cpp") return /^\s*\[cling\]\$\s?/.test(source);
|
|
14002
14064
|
return false;
|
|
14003
14065
|
}
|
|
14004
14066
|
|
|
@@ -14014,7 +14076,7 @@
|
|
|
14014
14076
|
if (bannerLines.length >= 16) break;
|
|
14015
14077
|
}
|
|
14016
14078
|
const banner = bannerLines.join("\n").trim();
|
|
14017
|
-
if (!/^(?:Python\s|IPython\s|R version\s|GHCi,\s|Clojure\s|Julia\s|julia\s)/i.test(banner)) return "";
|
|
14079
|
+
if (!/^(?:Python\s|IPython\s|R version\s|GHCi,\s|Clojure\s|Julia\s|julia\s|\|\s+Welcome to JShell\b)/i.test(banner)) return "";
|
|
14018
14080
|
return banner;
|
|
14019
14081
|
}
|
|
14020
14082
|
|
|
@@ -14089,7 +14151,8 @@
|
|
|
14089
14151
|
+ "<div class='repl-journal-header'><h3>Shared REPL Record</h3>" + toggleActions + "</div>"
|
|
14090
14152
|
+ "<p class='repl-journal-description'>What Studio and pi-repl have sent to this session.</p>"
|
|
14091
14153
|
+ (omitted ? "<div class='repl-journal-omitted'>Showing latest 12 entries for this session; " + escapeHtml(String(omitted)) + " older entries remain in export.</div>" : "")
|
|
14092
|
-
|
|
14154
|
+
// The prompt column fits the longest prompt, such as gnuplot>, in the prompt's own font.
|
|
14155
|
+
+ "<div class='repl-journal-list' style='--repl-studio-prompt-chars: " + Math.max(0, ...visibleEntries.map((entry) => getReplStudioPrompt(entry.runtime).length)) + "'>" + terminalContent + "</div>"
|
|
14093
14156
|
+ "</section>";
|
|
14094
14157
|
}
|
|
14095
14158
|
|
|
@@ -14152,6 +14215,12 @@
|
|
|
14152
14215
|
["r", "R"],
|
|
14153
14216
|
["ghci", "GHCi"],
|
|
14154
14217
|
["clojure", "Clojure"],
|
|
14218
|
+
["ruby", "Ruby"],
|
|
14219
|
+
["java", "Java"],
|
|
14220
|
+
["octave", "Octave"],
|
|
14221
|
+
["matlab", "MATLAB"],
|
|
14222
|
+
["gnuplot", "gnuplot"],
|
|
14223
|
+
["cpp", "C++"],
|
|
14155
14224
|
].map(([value, label]) => "<option value='" + escapeHtml(value) + "'" + (replRuntime === value ? " selected" : "") + ">" + escapeHtml(label) + "</option>").join("");
|
|
14156
14225
|
const runtimeLabel = getReplRuntimeLabel(replRuntime);
|
|
14157
14226
|
const visibleSessions = getReplSessionsForRuntime(replRuntime);
|
|
@@ -14182,6 +14251,9 @@
|
|
|
14182
14251
|
// New layout: how Send to REPL reads the editor lives here, not in the Prompt toolbar (Oliver, 10 Oct).
|
|
14183
14252
|
+ (bufferSwitchingEnabled && studioUiRefreshUi ? "<label class='repl-more-send-mode' title='Raw sends the selection or all the text. Literate sends the selection, the code chunk at the cursor, or all matching chunks.'>Send mode <select class='studio-flat-select' data-repl-send-mode aria-label='Send mode'" + (wsState === "Disconnected" || uiBusy || replBusy ? " disabled" : "") + ">"
|
|
14184
14253
|
+ [["raw", "Raw"], ["literate", "Literate"]].map(([value, label]) => "<option value='" + value + "'" + (replSendMode === value ? " selected" : "") + ">" + label + "</option>").join("") + "</select></label>" : "")
|
|
14254
|
+
// Pane echo sits with Send mode; the toolbar menu isn't shown in this layout (Oliver, 19 Oct).
|
|
14255
|
+
+ (bufferSwitchingEnabled && studioUiRefreshUi ? "<label class='repl-more-echo-mode' title='How much of the sent code the tmux pane shows: Summary up to 20 lines, Full up to 40, Off none.'>Pane echo <select class='studio-flat-select' data-repl-echo-mode aria-label='Pane echo'" + (wsState === "Disconnected" || uiBusy || replBusy ? " disabled" : "") + ">"
|
|
14256
|
+
+ [["off", "Off"], ["summary", "Summary"], ["full", "Full"]].map(([value, label]) => "<option value='" + value + "'" + (replEchoMode === value ? " selected" : "") + ">" + label + "</option>").join("") + "</select></label>" : "")
|
|
14185
14257
|
+ "<button type='button' data-repl-action='stop-session'" + (canStopActiveSession ? "" : " disabled") + " title='Stop the selected Studio-owned REPL session.'>Stop session</button>"
|
|
14186
14258
|
+ "<button type='button' data-repl-action='interrupt'" + (activeSession && !replBusy ? "" : " disabled") + " title='Send Ctrl+C to the active REPL session.'>Interrupt</button>"
|
|
14187
14259
|
+ "<button type='button' data-repl-action='copy-attach-command'" + (activeSession ? "" : " disabled") + " title='Copy command for attaching to this tmux session in a terminal.'>Copy attach command</button>"
|
|
@@ -31744,16 +31816,7 @@
|
|
|
31744
31816
|
}
|
|
31745
31817
|
|
|
31746
31818
|
if (replEchoModeSelect) {
|
|
31747
|
-
replEchoModeSelect.addEventListener("change", () =>
|
|
31748
|
-
setReplEchoMode(replEchoModeSelect.value);
|
|
31749
|
-
syncActionButtons();
|
|
31750
|
-
setStatus(replEchoMode === "full"
|
|
31751
|
-
? "Full pane echo enabled. Bounded submitted source code will remain in raw terminal history."
|
|
31752
|
-
: (replEchoMode === "off"
|
|
31753
|
-
? "Pane echo disabled; new sends will not add alignment anchors to raw terminal history."
|
|
31754
|
-
: "Summary pane echo enabled; short submissions will be shown with compact anchors and a plain output divider."),
|
|
31755
|
-
replEchoMode === "full" ? "warning" : "success");
|
|
31756
|
-
});
|
|
31819
|
+
replEchoModeSelect.addEventListener("change", () => chooseReplEchoMode(replEchoModeSelect.value));
|
|
31757
31820
|
}
|
|
31758
31821
|
|
|
31759
31822
|
copyDraftBtn.addEventListener("click", async () => {
|
package/client/studio.css
CHANGED
|
@@ -4990,16 +4990,19 @@
|
|
|
4990
4990
|
white-space: pre-wrap;
|
|
4991
4991
|
}
|
|
4992
4992
|
|
|
4993
|
+
/* The prompt column widens for a longer prompt (jshell>, octave>, gnuplot>), measured
|
|
4994
|
+
in the prompt's own font: --repl-studio-prompt-chars is the record's longest prompt. */
|
|
4993
4995
|
.repl-studio-code-row,
|
|
4994
4996
|
.repl-studio-output-row {
|
|
4995
4997
|
display: grid;
|
|
4996
|
-
grid-template-columns: var(--repl-studio-prompt-width) minmax(0, 1fr);
|
|
4998
|
+
grid-template-columns: minmax(var(--repl-studio-prompt-width), max-content) minmax(0, 1fr);
|
|
4997
4999
|
gap: var(--repl-studio-column-gap);
|
|
4998
5000
|
align-items: start;
|
|
4999
5001
|
}
|
|
5000
5002
|
|
|
5001
5003
|
.repl-studio-prompt,
|
|
5002
5004
|
.repl-studio-output-label {
|
|
5005
|
+
min-width: calc(var(--repl-studio-prompt-chars, 0) * 1ch);
|
|
5003
5006
|
font-family: var(--font-mono);
|
|
5004
5007
|
font-size: var(--studio-working-font-size);
|
|
5005
5008
|
line-height: 1.45;
|
|
@@ -7545,8 +7548,12 @@
|
|
|
7545
7548
|
/* Honor existing handler eligibility after controls are regrouped. */
|
|
7546
7549
|
body.studio-ui-refresh [hidden] { display: none !important; }
|
|
7547
7550
|
/* Dogfood workspace: two logical rows, with normal wrapping in small panes. */
|
|
7548
|
-
/* Room for "
|
|
7549
|
-
|
|
7551
|
+
/* Room for "Starting…" and "Stopping…", so nothing moves when a run starts, its clock ticks or it's stopped
|
|
7552
|
+
(Oliver, 14 Oct). Hidden copies in the page's own font set the width. The clock itself, "0:16", is narrower,
|
|
7553
|
+
and the old 13ch reserve for "Running 00:00" pushed the tools onto a second row (Oliver, 22 Oct). */
|
|
7554
|
+
.studio-run-status { color: var(--muted); font-size: 12px; min-width: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
|
|
7555
|
+
.studio-run-status::before { content: "Starting…"; display: block; height: 0; overflow: hidden; visibility: hidden; }
|
|
7556
|
+
.studio-run-status::after { content: "Stopping…"; display: block; height: 0; overflow: hidden; visibility: hidden; }
|
|
7550
7557
|
body.studio-ui-refresh #rightSectionHeader .studio-follow-button {
|
|
7551
7558
|
color: var(--muted); border: 0; border-radius: 0; background: transparent;
|
|
7552
7559
|
}
|
|
@@ -7582,6 +7589,13 @@
|
|
|
7582
7589
|
body.studio-workspace-layout .response-option-select-wrap:not(:has(select)) { display: none; }
|
|
7583
7590
|
body.studio-workspace-layout .reference-meta .source-badge,
|
|
7584
7591
|
body.studio-workspace-layout #historyIndexBadge { border: 0; border-radius: 0; background: transparent; }
|
|
7592
|
+
/* The response count sits at the right of the line, in the text colour, and in the accent colour while an
|
|
7593
|
+
older response is showing (Oliver, 22 Oct). */
|
|
7594
|
+
body.studio-workspace-layout .reference-meta:not([hidden]) { display: flex; align-items: center; gap: 8px; }
|
|
7595
|
+
/* As a row its labels' vertical padding would count, making the line 7 px taller than before (Astra). */
|
|
7596
|
+
body.studio-workspace-layout .reference-meta .source-badge { padding-top: 0; padding-bottom: 0; }
|
|
7597
|
+
body.studio-workspace-layout #rightPane #referenceHistoryCount { margin-left: auto; flex: none; color: var(--text); font-variant-numeric: tabular-nums; }
|
|
7598
|
+
body.studio-workspace-layout #rightPane #referenceHistoryCount.is-older { color: var(--accent); }
|
|
7585
7599
|
body.studio-workspace-layout .studio-refresh-action-line { flex-wrap: wrap; gap: 6px 10px; }
|
|
7586
7600
|
body.studio-workspace-layout .studio-refresh-menu > button { display: block; width: 100%; text-align: left; white-space: normal; }
|
|
7587
7601
|
body.studio-workspace-layout .response-result-row { flex-wrap: wrap; }
|
|
@@ -7809,7 +7823,9 @@
|
|
|
7809
7823
|
body.studio-workspace-layout .repl-more-menu button:not(:disabled):hover { border-color: transparent; background: var(--studio-header-action-hover-bg, var(--panel-2)); }
|
|
7810
7824
|
body.studio-workspace-layout .repl-more-menu button:disabled { color: var(--muted); }
|
|
7811
7825
|
body.studio-workspace-layout .repl-more-menu button:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 3px; }
|
|
7812
|
-
body.studio-workspace-layout .repl-more-send-mode
|
|
7826
|
+
body.studio-workspace-layout .repl-more-send-mode,
|
|
7827
|
+
body.studio-workspace-layout .repl-more-echo-mode { display: flex; align-items: center; gap: 6px; padding: 3px 8px 6px; margin-bottom: 2px; border-bottom: 1px solid var(--panel-border); color: var(--muted); font-size: 12px; }
|
|
7828
|
+
body.studio-workspace-layout .repl-more-send-mode:has(+ .repl-more-echo-mode) { padding-bottom: 3px; margin-bottom: 0; border-bottom: 0; }
|
|
7813
7829
|
body.studio-workspace-layout .files-pick-path { flex: 1 1 180px; min-width: 0; padding: 4px 8px; border: 1px solid var(--control-border); border-radius: 6px;
|
|
7814
7830
|
background: var(--panel); color: var(--text); font: 12px var(--font-mono); outline: none; }
|
|
7815
7831
|
body.studio-workspace-layout .files-pick-strip button { border-color: transparent; background: transparent; }
|