This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-25
Channels
- # announcements (30)
- # beginners (4)
- # calva (173)
- # cider (22)
- # clj-kondo (12)
- # clojure-austin (2)
- # clojure-brasil (1)
- # clojure-europe (56)
- # clojure-korea (1)
- # clojure-nl (1)
- # clojure-norway (53)
- # clojure-uk (5)
- # clojurescript (25)
- # data-science (82)
- # hyperfiddle (87)
- # introduce-yourself (11)
- # jobs-discuss (44)
- # malli (4)
- # off-topic (7)
- # pedestal (8)
- # re-frame (16)
- # releases (1)
- # shadow-cljs (41)
- # slack-help (5)
- # sql (1)
- # squint (1)
Recently something has changed that's causing most evaluation output results in the repl window in VScode being preceded by a semicolon. I've been trying to find where this is set (including reading back in this channel) but have been unsuccessful in finding a solution. Does anyone have quick pointer for me before I pull my hair out?:rolling_on_the_floor_laughing:
It’s that way because output was breaking the structure of the Clojure document of the REPL Window. There are now two additional output options that you can consider that do not print output prepended by semicolons. See https://calva.io/output/
I'm kinda used to having the evaluation output in the Repl window being in color and never use the output tab. The jack-in terminal shows my projects automatic evaluations.
It caused too much trouble. See if you can use the terminal output option or a combination of the repl window for result and the terminal for output.
No I can't, the project I work on has constant processes running in the background that print to the terminal window
It breaks structure if the output contains unbalanced brackets, or unmatched quotes. Or some backslash and probably some other situations.
Not sure how the constant process prevents you from using the terminal output destination?
We are probably going to retire the repl window as an output destination entirely at some point. It has performance problems that are a bit too involved to fix.
Well, we will not retire it until we have some alternative that doesn’t suffer the performance problems.
Well, the terminal output destination does not print into the Jack-in terminal. It’s a separate terminal. You can display it in split view or drag it into the editor area.
Doesn't really feel intuitive to have the result of a repl evaluation print in a window other then the actual repl to me.
Read Eval Print, to me means type something, evaluate it and print the outcome? If the print isn't in the same window you can easily overlook it? Plus adding another window/tab means having more to monitor? Sorry if I sound like an ass, just very used to the way it was
Will try the way you have it, my output window is not in color nor does it autoscroll, is that a setting?
oh my.. this is really confusing. the repl doesn't always give a new input prompt after evaluation
If you reevaluate something above your current cursor location you do not get a new prompt. It does when sing repl-window as output
Or, actually. If the new prompt would look the same as the current prompt, we skip printing it on purpose.
I recommend trying with the terminal as the destination instead. It autoscrolls more intuitively.
how do you get the output window in the editor area, I can only seem to get the log file there?
You can’t get the output channel in the editor area. But the with the terminal output, you can.
terminal window is not an option. for me still it is counter intuitive to have your repl eval output not below the code you evaluate (unless you ofcourse evaluate it from some other file then the repl window)
I’m curious and optimistic to try the new setup. One think I like about the repl output being in the editor window is that I can use regular vscode commands to navigate, select, and copy text/data from output. I use Cursorless, so I can say “bring” and target a specific data structure, token, or keyword from the output to fluently splice it back in to my working code. That being said I also clear the repl results regularly. (One reason is to see the top of the data, not auto-scroll). Cursive has scrolling setttings and a clear-results command for the repl that I was used to when coming into Calva
I miss that too from the other output options, @U09D96P9B.
You can copy the last evaluation result to the clipboard with a command, @U09D96P9B. You probably knew.
Replace output-channel
with terminal
, @U02CX2V8PJN.
Ahh now I see what you mean with terminal. I tried opening the Calva Output window before but got this error
I kinda agree with @U02CX2V8PJN’s points wrt REPL flow, trying the new combo now, since I miss the coloured output.
Which version of Calva are you using, @U02CX2V8PJN?
I've got the same error regarding focusing on terminal, I just wrote a new message on #calva
My Calva version is v2.0.430
So, this is what it amounts to. Still, having a second output window next to a repl window is counter intuitive to me. But, I will try using it at I am missing the coloured output
My version is:
Calva version used: v2.0.430
clojure-lsp version used: 2024.03.13-13.11.00
clj-kondo version used: 2024.03.13
Very strange that it warns about terminal
. I don’t understand why that happens. Will need to tale a closer look. But very confusing, I agree.
Could it be an option to have the output be printed in the repl window without the semi-colon? Disabled by default?
Could be, but I try to avoid settings in general, and if the setting means “Do not complain if the REPL window stops working” I hesitate even more.
When my REPL window stopped formatting due to some lingering extra characters I just killed the repl and jacked in again. Not optimal but worked for me.
As maintainers we at some point have spent enough time helping users with certain problems, and with trying to mitigate the problems.
We are planning to introduce a dedicated Output Window. Hopefully we can create an experience that suits most devs. Even if we will not be able to do the rope trick with making something that suits all.
I created a discussion in the Calva repo to continue https://github.com/BetterThanTomorrow/calva/discussions/2462
hashp #p outputs are destroyed by this
@U04M0JEU88Z you mean by the semi-colon? Have you tried the terminal output destination?
I have been trying the terminal output since yesterday and even though I like the terminal like output I have now been frustrated more then once due to me questioning why my evaluated code in the repl gave no output...doh:melting_face:
Same here @U02CX2V8PJN. I’ve learnt to expect the result being printed there. Maybe we could print something like “Results printed to <wherever>“…
I now print the result into the REPL, everything else into output. It is not as good as colourful everything in REPL but as I also suffered from REPL losing formatting due to rogue characters this is a compromise.
Regarding the option you suggested to allow to opt-in on stdout being printed raw, I am starting to lean towards doing something like that. It will be opt-in and be on your own with it , but I think that while we do not have an alternative that is similar enough, we could allow it and be clear about that it is temporary. Or something.
My thinking goes along the lines that result is crucial and in REPL, everything else is details and can be in the output.
Regarding REPL in same window, @U02CX2V8PJN, the coming output window will probably not have that. We are too scarred from having tried to provide that in different ways for 6 years now.
Isnt it weird that Exceptions get printed in both windows but ytou can only open (click on) the stacktrace in the repl window.
That is why the exception is printed to the repl window regardless. It’s the only place we have clickable stacktraces.
Hmm... imho a repl should have input and output in the same window. If I start clj or bb from command line I get the same
You could actually do it like that with Calva too. Start clj and the repl from the command line and connect calva to to that repl.
It's pity VSCode doesnt support having a split window for just 2 tabs. If I do that all other tabs suffer the same fate hehe. Kinda hard to explain, ill make a screenshot.
VS Code window/tab/panel management is a mess. It is strange that they allow it to be like that.
I usually split my workspace over 2 or 3 main tabs with files on those tabs. If I put the output and repl window on the left split like it is now the other files on those tabs cant be the full tab and are split too. Thats annoying like poop coming to quickly
I'd be happy with an option to remove the semi-colon from the repl-window and live with potential issues. but thats just me
That would provide feedback on repl info (even if preceded by a semi-colon) and if I would want colored output I can look in the terminal output
The results are colored in both. Though I don’t think that was what you referred to as it? Because results are not prepended as line comments.
You can print colored output to the terminal, but you will have to use ANSI escapes, which you can get from a library. The REPL window can’t handle that though, so we strip ANSI escapes there.
Here's an example. If I type and evaluate (= 1 1)
in the calva-repl and have all calva.outputDestinations
set to repl-window
the result would be like the bottom tab in the screenshot correct?
If I set the calva.outputDestinations
to terminal
I wouldn't get the result in the bottom window and it would print like the top window, correct?
Can it be both? Result in the repl-window and terminal.
What’s funny with your first screenshot is that it looks like the result of (= 1 1)
is printed to the repl window as a line comment.
https://calva.io/output/ describes ctrl+alt-o t
as a shortcut to open output terminal but I just get this error (`ctrl+shift+´` works tho)? Is this a bug? Using Emacs keybindings FWIW.
Cannot read properties of undefined (reading 'show')
My Calva version is v2.0.430
Looks like a bug. Are you connected to the repl with the terminal set as an output destination?
No
"calva.outputDestinations": {
"evalResults": "output-channel",
"evalOutput": "output-channel",
"otherOutput": "output-channel"
}
I did change the output destinations while REPL was running. Started it with the default settings
Could be that the terminal was not created when you used the command. Still a bug. Just trying to understand.
As soon as I changed output-channel or repl-window to terminal a new terminal spawned
I think it needs that something is printed to it. Which probably happened for you @U02CX2V8PJN
Ah, so the pseudo terminal started when jacking in is not the terminal. Shortcut works only if I have at least one output destination defined as terminal.
@U02CX2V8PJN, for your views on the repl input and output being in the same window. You are welcome to start a discussion on the Calva repo about it. If we have those discussions here we will have them over and over again. Better to have a URL to point at.
When configuring at least one terminal
destination shortcut works.
Issue created ➡️ https://github.com/BetterThanTomorrow/calva/issues/2461
Another nice thing in output window is that you can follow links easily. Seems like you can do this in output panel too. With terminal you can follow a link, but it pops up a security confirmation prompt… just observations
I moved the Output terminal to a “window” tab, to try it out. Then I instinctively closed the tab, like I would with the results window tab, when I wanted to “hide” the results view temporarily. With the results window I could bring the results view back with a command. But closing the output terminal seems to have killed the view, and I cannot get back to it. Even after re-jack in?
Ah, that’s true. I don’t think we can prevent it, but I think we can at least catch that it happens and say something about it to the user.
And we should be able to re-create it. Please report as an issue. @U09D96P9B.
As a workaround you can Pin
the window, this makes closing it have a second action
Ok thanks. What is best way to re-create it atm?
I guess reload window. I’ll try that.
Reload is probably the only thing that works for now. I missed that this could happen. But I think I know how to make it auto-recreate. Issue please. 😃 🙏
Ok will create issue later on. Yes reload works. (now show/open.. once dead)
Nice to have a proper “clear repl output” command with the terminal version! ❤️
![metal](https://emoji.slack-edge.com/T03RZGPFR/metal/9f936a4278.png)
You need to focus the terminal first, right? I was thinking we could add commands for clearing the configured destinations.
workbench.action.terminal.clear
Seems to work, even when I am in the editor window.
But specific clearing commands as needed are appreciated.
Wouldnt mind a setting to auto-clear before each evaluation. (but could wire that up myself if really needed)
This and a stably positioned REPL prompt are my top wishes for Calva. I mostly use regular editor buffers for evaluations, so it's not a big problem though.
Is there a way to have the calva terminal start out as a tab on window reload?
If it was a tab (editor) when the window was reloaded, I think it will be recreated there. I don’t think we can make it be created there otherwise, but I may be wrong about that.
Maybe a command to move it? Might need to look to Joyride for this.