Fork me on GitHub
#calva
<
2023-12-31
>
joakimen12:12:04

Hey there. What is the recommended way of dealing with a huge repl output file in Calva? I think I used to run the "Clear REPL History" command as mentioned in the docs here https://calva.io/output/, but that command isn't available to me anymore for some reason (latest Calva, latest VS Code). Any pointers?

1
pez12:12:39

> the "Clear REPL History" command as mentioned in the docs It’s still there. Maybe your repl isn’t connected? (For some reason this command only activates with a connected repl). Anyway, it doesn’t deal with the repl output, only the history function (`alt+up`). As for dealing with huge output... Select all and delete is what I do in lack of a clear output command. For actually working with huge output I think #C0185BFLLSE is the way to go.

joakimen12:12:06

I nuked the file manually, and I've disconnected and jacked in several times since then, but I suspect you're right that I must have been disconnected, because the command appears to me now! Sorry for the pebkac, and yeah portal is definitely awesome for navigating bigger structures 😄 Also, happy new years from Norway, Peter! 🎉

pez12:12:15

Happy New Year from Sweden, Joakim! 🎆

phill12:12:13

The repl output is kept in a file, somewhere under .calva. You can truncate -s 0 that file anytime from a terminal and Calva's output window will instantly be empty!

pez12:12:58

Yeah. The repl output is a file, actually. Only with some special attention from Calva when editing it.

phill12:12:09

A super-duper notebooking arrangement, actually. But I have a habit of eval'ing from other buffers using the "eval...insert result as comment" command, and the repl-output buffer gets slow when it gets too big, so I truncate often!

pez13:12:05

We’re (or @U9A1RLFNV, really) planning to do an experiment going back to a Webview for the repl window. Maybe we should remember that keeping a log is also nice so keeping some support for that if we leave the “plain file” path.

👀 1
seancorfield18:12:44

It might be nice to have an option for automatically shrinking the REPL output file so that it only keeps a certain number of lines or results or something...

👍 3
bringe21:12:33

Good idea ^ - a "truncate at x lines" (or x height) type of option. We should try to avoid truncating in the middle of forms, though. Maybe a number of forms truncation value would be good - not sure yet.

👍 2
David Yang15:01:31

Hey all - just curious if there’s a way in VS Code to not have output.calva-repl show up in the search results? I’ve tried adding it to search excludes and file excludes but it still shows up in search because I believe it’s the open window. I’m hacking on another extension and it seems like there’s an API called https://vshaxe.github.io/vscode-extern/vscode/TextDocumentContentProvider.html that supports this but haven’t used it yet.

1
pez16:01:05

The Calva output window is read/write though, so don’t think the TextDocumentContentProvider is an option? But I haven’t looked deeply at it so I may have it wrong.

David Yang16:01:56

sorry - good point, yes the buffer isn’t editable