Commit fa8e4768 authored by Dave Syer's avatar Dave Syer

Prevent JLine from expanding !history events

We might also want to rethink "!" as a shell exec command (since it means
something in a real shell and in JLine). E.g. use "exec" or something.

Partial fix for gh-220 (ideally we'd process the events and catch
and handle exceptions).
parent b07a1998
...@@ -105,6 +105,9 @@ public class ShellCommand extends AbstractCommand { ...@@ -105,6 +105,9 @@ public class ShellCommand extends AbstractCommand {
ConsoleReader reader = new ConsoleReader(); ConsoleReader reader = new ConsoleReader();
reader.addCompleter(new CommandCompleter(reader, this.springCli)); reader.addCompleter(new CommandCompleter(reader, this.springCli));
reader.setHistoryEnabled(true); reader.setHistoryEnabled(true);
// Prevent exceptions if user types !foo. If anyone knows how to process those
// exceptions, please help out and write some code.
reader.setExpandEvents(false);
reader.setCompletionHandler(new CandidateListCompletionHandler()); reader.setCompletionHandler(new CandidateListCompletionHandler());
return reader; return reader;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment