// Path: cliche-shell-core/src/main/java/com/maxifier/cliche/util/EmptyMultiMap.java
// public class EmptyMultiMap<K, V> implements MultiMap<K, V> {
// 
//     public void put(K key, V value) {
//         throw new UnsupportedOperationException("You can't modify EmptyMultyMap: it's always empty!");
//     }
// 
//     public Collection<V> get(K key) {
//         return new ArrayList<V>();
//     }
// 
//     public Set<K> keySet() {
//         return new HashSet<K>();
//     }
// 
//     public void remove(K key, V value) {
//         throw new UnsupportedOperationException("You can't modify EmptyMultyMap: it's always empty!");
//     }
// 
//     public void removeAll(K key) {
//         throw new UnsupportedOperationException("You can't modify EmptyMultyMap: it's always empty!");
//     }
// 
//     public int size() {
//         return 0;
//     }
// 
//     public void putAll(MultiMap<K, V> map) {
//         throw new UnsupportedOperationException("You can't modify EmptyMultyMap: it's always empty!");
//     }
// 
//     @Override
//     public String toString() {
//         return "{}";
//     }
// 
// 
// 
// }


import com.maxifier.cliche.util.EmptyMultiMap;
import jline.console.ConsoleReader;
import jline.console.completer.AggregateCompleter;
import jline.console.completer.StringsCompleter;
import jline.console.history.FileHistory;
import jline.console.history.History;
import jline.console.history.PersistentHistory;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.Environment;
import org.apache.sshd.server.ExitCallback;
import java.io.File;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
        this.out = new PrintStream(new TtyFilterOutputStream(out));
    }

    @Override
    public void setErrorStream(OutputStream err) {
        this.err = new PrintStream(err);
    }

    @Override
    public void setExitCallback(ExitCallback callback) {
        this.callback = callback;
    }

    @Override
    public void start(Environment env) throws IOException {
        this.future = executor.submit(new Runnable() {
            @Override
            public void run() {
                try {
                    consoleReader = new ConsoleReader(in, out);
                    consoleReader.setBellEnabled(true);
                    //history file is port based to separate apps
                    File historyFile = new File(System.getProperty("user.home"), ".clhistory" + port);
                    consoleReader.setHistory(new FileHistory(historyFile));
                    consoleReader.setHistoryEnabled(true);
                    consoleReader.setExpandEvents(false);

                    ConsoleIO io = new ConsoleIO(consoleReader, out, out);
                    List<String> path = new ArrayList<String>(1);
                    path.add(promt);
// Path: cliche-shell-core/src/main/java/com/maxifier/cliche/util/EmptyMultiMap.java
// public class EmptyMultiMap<K, V> implements MultiMap<K, V> {
// 
//     public void put(K key, V value) {
//         throw new UnsupportedOperationException("You can't modify EmptyMultyMap: it's always empty!");
//     }
// 
//     public Collection<V> get(K key) {
//         return new ArrayList<V>();
//     }
// 
//     public Set<K> keySet() {
//         return new HashSet<K>();
//     }
// 
//     public void remove(K key, V value) {
//         throw new UnsupportedOperationException("You can't modify EmptyMultyMap: it's always empty!");
//     }
// 
//     public void removeAll(K key) {
//         throw new UnsupportedOperationException("You can't modify EmptyMultyMap: it's always empty!");
//     }
// 
//     public int size() {
//         return 0;
//     }
// 
//     public void putAll(MultiMap<K, V> map) {
//         throw new UnsupportedOperationException("You can't modify EmptyMultyMap: it's always empty!");
//     }
// 
//     @Override
//     public String toString() {
//         return "{}";
//     }
// 
// 
// 
// }


// Path: cliche-shell-core/src/main/java/com/maxifier/cliche/SshShellCommand.java
import com.maxifier.cliche.util.EmptyMultiMap;
import jline.console.ConsoleReader;
import jline.console.completer.AggregateCompleter;
import jline.console.completer.StringsCompleter;
import jline.console.history.FileHistory;
import jline.console.history.History;
import jline.console.history.PersistentHistory;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.Environment;
import org.apache.sshd.server.ExitCallback;
import java.io.File;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;

        this.out = new PrintStream(new TtyFilterOutputStream(out));
    }

    @Override
    public void setErrorStream(OutputStream err) {
        this.err = new PrintStream(err);
    }

    @Override
    public void setExitCallback(ExitCallback callback) {
        this.callback = callback;
    }

    @Override
    public void start(Environment env) throws IOException {
        this.future = executor.submit(new Runnable() {
            @Override
            public void run() {
                try {
                    consoleReader = new ConsoleReader(in, out);
                    consoleReader.setBellEnabled(true);
                    //history file is port based to separate apps
                    File historyFile = new File(System.getProperty("user.home"), ".clhistory" + port);
                    consoleReader.setHistory(new FileHistory(historyFile));
                    consoleReader.setHistoryEnabled(true);
                    consoleReader.setExpandEvents(false);

                    ConsoleIO io = new ConsoleIO(consoleReader, out, out);
                    List<String> path = new ArrayList<String>(1);
                    path.add(promt);
                    theShell = new Shell(new Shell.Settings(io, io, new EmptyMultiMap(), false),