Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add more client-side commands #116

trptcolin opened this Issue May 31, 2013 · 1 comment


None yet
2 participants

trptcolin commented May 31, 2013

Currently we just have one of these, for exiting, available via exit, quit, etc.

It might be nice to have more of these. One example, from Giles Bowkett on twitter, would be the history, similar to what bash has. <Ctrl-r>/<Ctrl-s> (in v0.2.0) are nice but this would be handy too (e.g. run stats in clojure on what commands are most common?)

I'm assuming there are other use cases as well (debugger? swapping out completion lib? panic button+reset to start state?), so would like to make this extensible.


  • Make commands easy to call.
  • Make it easy to discover what the various commands are.
  • Make it easy to add new commands.
  • Don't take all the good names away from users, e.g. currently if a user has a var called exit, they can't eval it by typing it [alone] on a line and pressing enter. This will seem broken, and more commands means more likelihood of brokenness.

Problem to overcome:
Evaluation of these commands actually must happen on the client side of the nREPL, which prevents us from using the typical clojure namespacing mechanisms to separate bits of functionality. For the history feature, for example, we need execution on the client because the client is where jline executes & writes to the history file.

Half-baked ideas:

  • Using a syntax that is actually illegal clojure would prevent clashes w/ user code (at the cost of being a bit weird-looking).
  • Using a special keypress to get you into a command mode would aid discoverability (but hurt ease of calling).
  • Could it this be an nREPL middleware on the client side of the connection? Is that even something you can do w/ nREPL middleware?

hyPiRion commented Aug 27, 2013

Erlang's Eshell uses ^G (CTRL+G) to go into "User switch command" mode, where you can call things like quit, connect to other shells, start remote shells etc. Maybe it would be interesting to put exit and quit in a similar thing to avoid them to shadow actual functions named that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment