cider
cider copied to clipboard
Customize banner
When repling into live systems, it would be nice to make it clear that you are not connected to your local system.
Currently there is just a boolean cider-repl-display-help-banner but the actual banner is hard coded and not customizable.
Ideally, the banner could be:
- customizable
- maybe even passed as argument since it might change even in the same project (if you connect to dev/prod)
- maybe even computed by a custom function? If the host/port is enough to know what banner you want for example
Sounds reasonable to me!
maybe even computed by a custom function?
Did you mean that users would pass a lambda (host port) and that CIDER would invoke it adequately?
Sounds reasonable to me!
maybe even computed by a custom function?
Did you mean that users would pass a
lambda (host port)and that CIDER would invoke it adequately?
Yeah that would be an option. It might be generic enough to support all the use cases maybe?
maybe even computed by a custom function? If the host/port is enough to know what banner you want for example
I think that making this a customizable function would be best. I don't think the first line of the message is part of the help banner, so we probably don't even need the host/port params.
I'm thinking it might actually be better to introduce some optional user banner function that takes every useful param we can think of and substitutes the help banner when present (or appears after it), given that the help banner is just static text. Something along those lines.
Indeed. The fn could take a single nrepl-dict as a param, so that it can grow without breaking changes?
Why a dict? It can just be some standard alist or a plist, as I doubt this data will have anything to do with nREPL messages which the dicts were created to model.
It's simply a nice / commonly used 'API', but no strong preference from my side.
Maybe not exactly related, but I also saw that you can pass a custom greeting-fn function to nrepl/start-server.
You'll definitely have all the information you need (to distinguish staging/prod for example) on the server side, and maybe I can also use that to let users know where they are connected to?