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

**Describe the solution you'd like**
Subset of what `reset` command does.
// This allows us to handle queries like:
             select 1
            elimited by semicolon and not by a
            // newline.
            if (insert_ast && inata)
            
                this_query_end = insert_ast->end;
                adjustQueryEnd(th all_queries_end,
                    context.getSettingsRef().max_parser_depth);
            }
            // Now we know for sure where the query ends.
            // Look for the hint in the text of query + insert data + trailing
            // comments,
            // e.g. insert into V 'a' --  serverError 123 }.
            // Use the updated query boundaries we just calculated.
            TestHint test_hint(test_mode, std::string(this_query_begin,
                this_query_end - this_query_begin));
            // Check whether the error (or its absence) matches the test hints
            // (or their absence).
            bool erro
            if (have_error)
            
                if (test_hint.serverError())
                
                    if (!server_exception)
                    
                        error_malse;
                        fmt::print(stderr,
                            "Expected server error code '}' but got no server error.\n",
                            test_hint.serverError());