presto-cli/src/main/java/io/prestosql/cli/InputReader.java/InputReader/close
class InputReader:    @Override
    public void close()
            throws IOException
    {
        try (Closer closer = Closer.create()) {
            closer.register(getHistory()::save);
            closer.register(getTerminal());
        }
    }