File tree Expand file tree Collapse file tree
client/src/clojure_cli/repl Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Changelog
22===========
33
4+ * 0.2.1 on Oct 19, 2026
5+ * Add ` :echo-editor-code ` to show only output from editor evaluations
46* 0.2.0 on Oct 19, 2026
57 * Show evaluations sent from an editor in the terminal REPL
68 * TAB completion using the nREPL completions op
Original file line number Diff line number Diff line change 398398 (.setPrompt rdr (render-prompt prompt-fn))
399399 (.redisplay rdr))
400400
401- (defn show-reply [evals {:keys [eval-id code out err value status] :as reply} rdr prompt-fn libspecs follow-ns?]
402- (when code (print-echo reply prompt-fn))
401+ (defn show-reply [evals {:keys [eval-id code out err value status] :as reply} rdr prompt-fn libspecs follow-ns? echo-code? ]
402+ (when ( and code echo-code?) (print-echo reply prompt-fn))
403403 (when-let [text (or out err value)] (api/print-above [{:text (str/trim-newline text)}]))
404404 (let [merged (merge (get evals eval-id) reply)]
405405 (if (some #{" eval-done" } status)
411411 " Runs on its own thread since the main thread is waiting for input.
412412 Continues to run until the connection is closed.
413413 Replies are collected until each eval is done."
414- [port session-id rdr prompt-fn libspecs follow-ns?]
414+ [port session-id rdr prompt-fn libspecs follow-ns? echo-code? ]
415415 (future
416416 (reduce (fn [evals reply]
417- (try (show-reply evals reply rdr prompt-fn libspecs follow-ns?)
417+ (try (show-reply evals reply rdr prompt-fn libspecs follow-ns? echo-code? )
418418 (catch Throwable e
419419 (api/print-above [{:text (str " clojure-cli.repl: watch: " (ex-message e))}])
420420 evals)))
444444 (handle [_ _sig]
445445 (nrepl/interrupt session))))
446446 (println " connected to nREPL on" port)
447- (watch-evals port session-id rdr prompt-fn libspecs (:follow-editor-ns config))
447+ (watch-evals port session-id rdr prompt-fn libspecs (:follow-editor-ns config) ( :echo-editor-code config true ) )
448448 (auto-require @api/current-ns libspecs)
449449 (loop []
450450 (let [line (try (.readLine rdr (render-prompt prompt-fn))
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ The scope column names the process a key configures. Either the JLine client or
4545| ` :paredit/<op> ` | client | [ key string] ( #key-strings ) | Bind a [ structural editing op] ( editing.md ) . Example: ` :paredit/raise "C-x r" ` . | none |
4646| ` :auto-require ` | client | vector of libspecs | [ Required into each namespace] ( #auto-require ) . | none |
4747| ` :follow-editor-ns ` | client | boolean | Enter the namespace of each eval [ sent from an editor] ( editors.md ) . | ` false ` |
48+ | ` :echo-editor-code ` | client | boolean | Show the code of each eval [ sent from an editor] ( editors.md ) above its output. | ` true ` |
4849| ` :middleware ` | server | vector of [ qualified symbols] ( #user-code ) | [ Server data on eval responses] ( middleware.md ) . | none |
4950| ` :eval-hook ` | server | [ qualified symbol] ( #user-code ) | [ Wraps eval] ( hooks.md ) . | none |
5051| ` :print-hook ` | server | [ qualified symbol] ( #user-code ) | [ Wraps result printing] ( hooks.md ) . | none |
Original file line number Diff line number Diff line change @@ -28,6 +28,15 @@ file that it writes.
2828When an editor starts the server, run ` clojure -M:attach ` to launch the terminal
2929REPL, by hand or scripted from your editor.
3030
31+ ## Code echo
32+
33+ Set ` :echo-editor-code ` to ` false ` to show only the output of each editor evaluation.
34+
35+ ``` clojure
36+ ; ; .cljconf/org.clojure/clojure-cli.repl.edn
37+ {:echo-editor-code false }
38+ ```
39+
3140## Namespace
3241
3342Each editor evaluation runs in the namespace of the file that the code comes
You can’t perform that action at this time.
0 commit comments