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

**Describe the solution you'd like**
Subset of what `reset` command does.
}
        /// Do not change context (current DB, settings) in case of an exception.
        if (!have_error)
        
            if (const auto * set_query = parsed_query->as<ASTSetQuery>())
            
                /// Save all changes in settings to avoid losing them if the n is lost.
                for (const auto & change : set_query->changes)
                
                    if (change.name == "profile")
                        current_profile = change.value.safeGet<String>();
                    else
                        context.applySettingChange(change);
                }
            }
            if (const auto * use_query = parsed_query->as<ASTUseQuery>())
            
                const String & new_database = use_query->database;
                /// If the client initiates the ren, it takes the settings from the config.
                config().setString("database", new_database);
                /// If the n initiates the ren, it uses its variable.
                n->setDefaultDatabase(new_database);
            }
        }
        if (is_interactive)
        
            std::cout << st
                << processed_rows << " rows in set. Elapsed: " << watch.elapsedSeconds() << " sec. ";
            if (progress.read_rows >= 1000)
                writeFinalProgress();