-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE REQUEST] persist REPL history to a file --- [was: drop a CIDER REPL connection without killing the REPL buffer] #2353
Comments
This proposal would unnecessary complexity both in implementation and for the user. Reusing volatile REPL history is just a shaky strategy. If you want to replicate commands, just create a script file and run it in different VMs. It's "the source is real" philosophy. BTW, the "creating a zombie cider repl" or the "re-use zombie REPL" no longer work in dev CIDER. It was deemed a micro-management with little added value. The following would be the recommended approach for your case:
|
i disagree: creating a separate buffer of commands is great when you know what you are wanting to do, but i find it impractical in an exploratory setting btw what is "volatile REPL history" ? surely the history is just an immutable sequence of commands ? perfect for event-replay ! i can use |
It's not persistent by default. Your emacs crashes and boom, you have to rewrite from scratch. In any case, your problem is real. But instead of focusing of how to ping-pong the REPL buffer around, it's probably better to focus on persistent cider REPL history instead. For instance, if you work in one project with a repl, start another session within same project, the new session should inherit the old history. And maybe repls should persist into the same file (configurable by the user). This brings up the old issue of moving cicer-repl on top of comint which allows automatic persistence, but well, a topic for another day.
Hopefully not anymore. With new connection API session are linked to contexts (project, directory and buffer) and one can no longer operate on a wrong REPL by mistake. If you have multiple sessions links to the same context then the most recently used session is picked automatically. This basically means that you have to keep a REPL open and all your commands will operate on that REPL. Simple. |
persisting REPL history into a file could work well for me context identification may also work for me - is that already released ? i couldn't see anything relevant in the CHANGELOG.md |
Then let's create an issue for this, or relabel this one.
It's in dev, still experimental and not yet documented. See #2324. |
I'm puzzled by your conversation - it has been possible to persist the REPL history to a file for years. See |
lol - pretty sure i don't know half of the things cider can do if |
Yeah, it's shared history for all REPLs regardless of their session. With .dir-locals.el you can have a separate file per project if needed. |
Hmm. Forgot about it. I actually have that file configured :/ In any event, it would be nice to be able to configure Another point of improvement is to make history clj/cljs specific. |
Yeah, there’s plenty of room for improvement. Maybe we should also enable
this by default. Not sure why we didn’t do this in the past.
On Thu, 28 Jun 2018 at 23:14, Vitalie Spinu ***@***.***> wrote:
Hmm. Forgot about it. I actually have that file configured :/
In any event, it would be nice to be able to configure
cider-repl-history-file to save history in a project specific fashion. As
an example, if cider-repl-history-file is relative, save it in a relative
path from the project root. .dir-locals for every project just to
accommodate this pattern is too much effort.
Another point of improvement is to make history clj/cljs specific.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2353 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGVyg0GW0zmzJcoemqTKESiBLKLp49tks5uBUclgaJpZM4U7S3r>
.
--
Best Regards,
Bozhidar Batsov
http://www.batsov.com
|
Maybe we can keep it open until we at least file tickets for the improvements suggested by @vspinu. All of them are trivial to implement and I guess it's worth us keeping a track of those, so we won't forget about them. |
Could be closed in favor of #2363 |
i often find myself wanting to re-connect a CIDER REPL session to a different VM, preserving command history - often this is for comparing behaviours between different versions of the same software running in different VMs
currently the only way i can do this is to kill the VM, creating a zombie CIDER REPL buffer, and then reconnect CIDER choosing to re-use the zombie REPL buffer
having to kill the VM is not ideal - i often don't really want to kill it. it would be great if it were possible to disconnect a CIDER REPL session without killing the REPL buffer
The text was updated successfully, but these errors were encountered: