**Use case**
Some program left garbage in terminal.

**Describe the solution you'd like**
Subset of what `reset` command does.
// beneficial so that we see proper trailing comments in "echo" and
            // server log.
            adjustQueryEnd(th all_queries_end,
                context.getSettingsRef().max_parser_depth);
            // full_query is the query + inline INSERT data + trailing comments
            // (the latter is our best guess for now).
            ubstr(
                this_query_begin - all_queries_text.data(),
                this_query_end - this_query_begin);
            if (query_fuzzer_runs)
            
                if (!processWithFuzzing(full_query))
                    return false;
                this_query_begin = this_query_end;
                continue;
            }
            try
            
                processParsedSingleQuery();
            }
            catch (...)
            
                // Surprising client error. A server error would
                // have been reported w/o throwing (see onReceiveSeverException()).
                client_exception = std::make_unique<Exception>(
                    getCurrentExceptionMessage(true), getCurrentExceptionCode());
                have_error = true;
            }
            // For INSERTs with inline data: use the end of inline data as
            // reported by the format parser (it is saved in sendData()).