I’m using the Scala REPL to interactively test some hash functions I’m building. I’m constantly switching between the product code (Eclipse), the browser and the Scala interpreter, doing copy/paste of values and results. In the mix I’m often doing CTRL-C on the interpreter, exiting the session and loosing all my functions.
Is there any way to let the Scala REPL either ignore CTRL-C or, even better, perform “paste” with it? I’m working on Linux.
I only know how to prevent REPL from exiting. Remapping of
CTRL+Cto perform copy command could be done in the same way (if there is some command that ables to change keymap w/out restarting terminal — I don’t know is there one). Anyways, to block^Cwrap your REPL invocation in .sh script like this:trap command
2 is a SIGINT value (that’s the signal which is triggered when you press
CTRL+C)