MCPcopy Create free account
hub / github.com/LagPixelLOL/ChatGPTCLIBot / initialize_or_throw

Function initialize_or_throw

main/interface/util/TermUtils.cpp:161–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159 }
160
161 std::unique_ptr<Term::Terminal> initialize_or_throw(const bool& clear_screen, const bool& disable_signal_keys, const bool& hide_cursor) {
162 if (!Term::stdin_connected() || !Term::stdout_connected()) {
163 throw Term::Exception("The terminal is not attached to a TTY and therefore can't catch user input.");
164 }
165 return std::make_unique<Term::Terminal>(clear_screen, disable_signal_keys, hide_cursor);
166 }
167} // util

Callers 3

setup_console_encodingFunction · 0.85
get_multilineFunction · 0.85
print_csFunction · 0.85

Calls 1

ExceptionClass · 0.85

Tested by

no test coverage detected